diff --git a/abad.lua b/abad.lua index 4b5786c..2cb0a70 100644 --- a/abad.lua +++ b/abad.lua @@ -88,6 +88,10 @@ function abad_state_normal() abad.update=abad_state_jumping abad.step=0 abad.jumpfwd=false + if abad.jump then + stopsound(abad.jump) + abad.jump=nil + end playsnd(audio_abad_jump) elseif btn(KEY_DOWN) then abad.update=abad_state_crouch @@ -162,7 +166,7 @@ function abad_state_walking() abad.wait=0 abad.step=(abad.step+1)%2 if abad.step==0 then - playsnd(audio_abad_step[abad.mustep]) + playsnd(audio_abad_step[abad.mustep],32) abad.mustep = abad.mustep + 1 if abad.mustep == 5 then abad.mustep=1 end end @@ -182,6 +186,10 @@ function abad_state_walking() abad.update=abad_state_jumping abad.step=0 abad.jumpfwd=true + if abad.jump then + stopsound(abad.jump) + abad.jump=nil + end playsnd(audio_abad_jump) return elseif btn(KEY_DOWN) then @@ -244,7 +252,7 @@ function abad_state_jumping() end elseif abad.step>6 then abad.update=abad_state_falling - playsnd(audio_abad_fall) + abad.jump=playsnd(audio_abad_fall) end abad.step=abad.step+1 end @@ -288,13 +296,16 @@ function abad_state_stairs() if btn(KEY_RIGHT) then abad.flip=false abad_advance() + playsnd(audio_low) elseif btn(KEY_LEFT) then abad.flip=true abad_advance() + playsnd(audio_low) elseif btn(KEY_UP) then if abad.y>0 then if check_tile(abad.hab,abad.x+4,abad.y+8)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+8)==tiletype.stair then abad.y=abad.y-2 + playsnd(audio_low) end else abad.hab=abad.hab-10 @@ -305,6 +316,7 @@ function abad_state_stairs() if abad.y<32 then if check_tile(abad.hab,abad.x+4,abad.y+16)==tiletype.stair or (abad.x+4)&7~=0 and check_tile(abad.hab,abad.x+12,abad.y+16)==tiletype.stair then abad.y=abad.y+2 + playsnd(audio_low) end else abad.hab=abad.hab+10