- Mute implementat
This commit is contained in:
16
abad.lua
16
abad.lua
@@ -30,16 +30,16 @@ end
|
||||
|
||||
function abad_hurt(howmuch)
|
||||
if abad.hurting == 0 then
|
||||
playchirp(audio_abad_hit)
|
||||
play(audio_abad_hit)
|
||||
abad.energia=abad.energia-howmuch
|
||||
if abad.energia<=0 then
|
||||
abad.vides=abad.vides-1
|
||||
if abad.vides==0 then
|
||||
--final de la partida
|
||||
dead.start()
|
||||
playchirp(audio_game_over, true)
|
||||
play(audio_game_over, true)
|
||||
else
|
||||
playchirp(audio_life_lost, true)
|
||||
play(audio_life_lost, true)
|
||||
abad.energia=40
|
||||
abad.hab=abad.safe.hab
|
||||
abad.x=abad.safe.x
|
||||
@@ -80,11 +80,11 @@ function abad_state_normal()
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=false
|
||||
playchirp(audio_abad_jump)
|
||||
play(audio_abad_jump)
|
||||
elseif btn(KEY_DOWN) then
|
||||
abad.update=abad_state_crouch
|
||||
elseif btnp(KEY_SPACE) and cacau.hab==-1 then
|
||||
playchirp(audio_abad_shot)
|
||||
play(audio_abad_shot)
|
||||
abad.update=abad_state_fire
|
||||
abad.wait=0
|
||||
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
|
||||
@@ -152,7 +152,7 @@ function abad_state_walking()
|
||||
abad.wait=0
|
||||
abad.step=(abad.step+1)%2
|
||||
if abad.step==0 then
|
||||
playchirp(audio_abad_step[abad.mustep])
|
||||
play(audio_abad_step[abad.mustep])
|
||||
abad.mustep = abad.mustep + 1
|
||||
if abad.mustep == 5 then abad.mustep=1 end
|
||||
end
|
||||
@@ -172,7 +172,7 @@ function abad_state_walking()
|
||||
abad.update=abad_state_jumping
|
||||
abad.step=0
|
||||
abad.jumpfwd=true
|
||||
playchirp(audio_abad_jump)
|
||||
play(audio_abad_jump)
|
||||
return
|
||||
elseif btn(KEY_DOWN) then
|
||||
abad.update=abad_state_crouch
|
||||
@@ -234,7 +234,7 @@ function abad_state_jumping()
|
||||
end
|
||||
elseif abad.step>6 then
|
||||
abad.update=abad_state_falling
|
||||
playchirp(audio_abad_fall)
|
||||
play(audio_abad_fall)
|
||||
end
|
||||
abad.step=abad.step+1
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user