* `player_damage`: Played when the local player takes damage (gain = 0.5)
* `player_falling_damage`: Played when the local player takes
damage by falling (gain = 0.5)
+ * `player_jump`: Played when the local player jumps
* `default_dig_<groupname>`: Default node digging sound
(see node sound definition for details)
public:
bool makes_footstep_sound;
float m_player_step_timer;
+ float m_player_jump_timer;
SimpleSoundSpec m_player_step_sound;
SimpleSoundSpec m_player_leftpunch_sound;
m_sound(sound),
m_ndef(ndef),
makes_footstep_sound(true),
- m_player_step_timer(0)
+ m_player_step_timer(0.0f),
+ m_player_jump_timer(0.0f)
{
}
}
}
+ void playPlayerJump()
+ {
+ if (m_player_jump_timer <= 0.0f) {
+ m_player_jump_timer = 0.2f;
+ m_sound->playSound(SimpleSoundSpec("player_jump", 0.5f), false);
+ }
+ }
+
static void viewBobbingStep(MtEvent *e, void *data)
{
SoundMaker *sm = (SoundMaker *)data;
static void playerJump(MtEvent *e, void *data)
{
- //SoundMaker *sm = (SoundMaker*)data;
+ SoundMaker *sm = (SoundMaker *)data;
+ sm->playPlayerJump();
}
static void cameraPunchLeft(MtEvent *e, void *data)
void step(float dtime)
{
m_player_step_timer -= dtime;
+ m_player_jump_timer -= dtime;
}
};