- Si està caiguent i torna a botar, que pare el só de caure
- Baixar el volum dels pasos - Roidet al pujar i baixar escaleres
This commit is contained in:
16
abad.lua
16
abad.lua
@@ -88,6 +88,10 @@ function abad_state_normal()
|
|||||||
abad.update=abad_state_jumping
|
abad.update=abad_state_jumping
|
||||||
abad.step=0
|
abad.step=0
|
||||||
abad.jumpfwd=false
|
abad.jumpfwd=false
|
||||||
|
if abad.jump then
|
||||||
|
stopsound(abad.jump)
|
||||||
|
abad.jump=nil
|
||||||
|
end
|
||||||
playsnd(audio_abad_jump)
|
playsnd(audio_abad_jump)
|
||||||
elseif btn(KEY_DOWN) then
|
elseif btn(KEY_DOWN) then
|
||||||
abad.update=abad_state_crouch
|
abad.update=abad_state_crouch
|
||||||
@@ -162,7 +166,7 @@ function abad_state_walking()
|
|||||||
abad.wait=0
|
abad.wait=0
|
||||||
abad.step=(abad.step+1)%2
|
abad.step=(abad.step+1)%2
|
||||||
if abad.step==0 then
|
if abad.step==0 then
|
||||||
playsnd(audio_abad_step[abad.mustep])
|
playsnd(audio_abad_step[abad.mustep],32)
|
||||||
abad.mustep = abad.mustep + 1
|
abad.mustep = abad.mustep + 1
|
||||||
if abad.mustep == 5 then abad.mustep=1 end
|
if abad.mustep == 5 then abad.mustep=1 end
|
||||||
end
|
end
|
||||||
@@ -182,6 +186,10 @@ function abad_state_walking()
|
|||||||
abad.update=abad_state_jumping
|
abad.update=abad_state_jumping
|
||||||
abad.step=0
|
abad.step=0
|
||||||
abad.jumpfwd=true
|
abad.jumpfwd=true
|
||||||
|
if abad.jump then
|
||||||
|
stopsound(abad.jump)
|
||||||
|
abad.jump=nil
|
||||||
|
end
|
||||||
playsnd(audio_abad_jump)
|
playsnd(audio_abad_jump)
|
||||||
return
|
return
|
||||||
elseif btn(KEY_DOWN) then
|
elseif btn(KEY_DOWN) then
|
||||||
@@ -244,7 +252,7 @@ function abad_state_jumping()
|
|||||||
end
|
end
|
||||||
elseif abad.step>6 then
|
elseif abad.step>6 then
|
||||||
abad.update=abad_state_falling
|
abad.update=abad_state_falling
|
||||||
playsnd(audio_abad_fall)
|
abad.jump=playsnd(audio_abad_fall)
|
||||||
end
|
end
|
||||||
abad.step=abad.step+1
|
abad.step=abad.step+1
|
||||||
end
|
end
|
||||||
@@ -288,13 +296,16 @@ function abad_state_stairs()
|
|||||||
if btn(KEY_RIGHT) then
|
if btn(KEY_RIGHT) then
|
||||||
abad.flip=false
|
abad.flip=false
|
||||||
abad_advance()
|
abad_advance()
|
||||||
|
playsnd(audio_low)
|
||||||
elseif btn(KEY_LEFT) then
|
elseif btn(KEY_LEFT) then
|
||||||
abad.flip=true
|
abad.flip=true
|
||||||
abad_advance()
|
abad_advance()
|
||||||
|
playsnd(audio_low)
|
||||||
elseif btn(KEY_UP) then
|
elseif btn(KEY_UP) then
|
||||||
if abad.y>0 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
|
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
|
abad.y=abad.y-2
|
||||||
|
playsnd(audio_low)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
abad.hab=abad.hab-10
|
abad.hab=abad.hab-10
|
||||||
@@ -305,6 +316,7 @@ function abad_state_stairs()
|
|||||||
if abad.y<32 then
|
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
|
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
|
abad.y=abad.y+2
|
||||||
|
playsnd(audio_low)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
abad.hab=abad.hab+10
|
abad.hab=abad.hab+10
|
||||||
|
|||||||
Reference in New Issue
Block a user