1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Digging and placing sounds

This commit is contained in:
Perttu Ahola 2012-03-24 00:33:58 +02:00
parent 6c14025b2d
commit 77120a021d
4 changed files with 96 additions and 16 deletions

View file

@ -188,13 +188,23 @@ void Camera::step(f32 dtime)
if (m_digging_button != -1)
{
f32 offset = dtime * 3.5;
float m_digging_anim_was = m_digging_anim;
m_digging_anim += offset;
if (m_digging_anim >= 1)
{
m_digging_anim = 0;
m_digging_button = -1;
MtEvent *e = new SimpleTriggerEvent("CameraDig");
m_gamedef->event()->put(e);
}
float lim = 0.15;
if(m_digging_anim_was < lim && m_digging_anim >= lim)
{
if(m_digging_button == 0){
MtEvent *e = new SimpleTriggerEvent("CameraPunchLeft");
m_gamedef->event()->put(e);
} else if(m_digging_button == 1){
MtEvent *e = new SimpleTriggerEvent("CameraPunchRight");
m_gamedef->event()->put(e);
}
}
}
}