From a4735c52e649b9f9d3bf1e610be2a2e82e07e85d Mon Sep 17 00:00:00 2001 From: JailDoctor Date: Thu, 12 Jan 2023 20:01:43 +0100 Subject: [PATCH] =?UTF-8?q?-=20Si=20est=C3=A0=20caiguent=20i=20torna=20a?= =?UTF-8?q?=20botar,=20que=20pare=20el=20s=C3=B3=20de=20caure=20-=20Baixar?= =?UTF-8?q?=20el=20volum=20dels=20pasos=20-=20Roidet=20al=20pujar=20i=20ba?= =?UTF-8?q?ixar=20escaleres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abad.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) 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