- Passat a mini v1.3.7

- [NEW] ara es pot activar i desactivar el só, des del nou menu d'opcions i desde el menu in-game
- [NEW] menus canviats un poc
This commit is contained in:
2025-10-30 16:31:07 +01:00
parent a5d097aa50
commit 639fd6e34d
10 changed files with 261 additions and 243 deletions

View File

@@ -38,16 +38,16 @@ end
function abad_hurt(howmuch)
if abad.hurting == 0 and abad.respawning==0 then
playsnd(audio_abad_hit)
sound.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()
playmus(audio_game_over,0)
music.play(audio_game_over,0)
else
playmus(audio_life_lost,0)
music.play(audio_life_lost,0)
abad.energia=40
abad.hab=abad.safe.hab
abad.x=abad.safe.x
@@ -97,13 +97,13 @@ function abad_state_normal()
sound.stop(abad.jump)
abad.jump=nil
end
playsnd(audio_abad_jump)
sound.play(audio_abad_jump)
elseif key.down(keyDown) or pad.down(btnDown) then
abad.update=abad_state_crouch
--elseif btn(KEY_Z) then
-- abad.respawning=240
elseif key.down(keyShoot) or pad.down(btnShoot) and cacau.hab==-1 then
playsnd(audio_abad_shot)
sound.play(audio_abad_shot)
abad.update=abad_state_fire
abad.wait=0
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
@@ -171,7 +171,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],32)
sound.play(audio_abad_step[abad.mustep],32)
abad.mustep = abad.mustep + 1
if abad.mustep == 5 then abad.mustep=1 end
end
@@ -195,12 +195,12 @@ function abad_state_walking()
sound.stop(abad.jump)
abad.jump=nil
end
playsnd(audio_abad_jump)
sound.play(audio_abad_jump)
return
elseif key.down(keyDown) or pad.down(btnDown) then
abad.update=abad_state_crouch
elseif key.down(keyShoot) or pad.down(btnShoot) and cacau.hab==-1 then
playsnd(audio_abad_shot)
sound.play(audio_abad_shot)
abad.update=abad_state_fire
abad.wait=0
cacau.init(abad.hab,abad.x+8,abad.y+8,abad.flip)
@@ -258,7 +258,7 @@ function abad_state_jumping()
end
elseif abad.step>6 then
abad.update=abad_state_falling
abad.jump=playsnd(audio_abad_fall)
abad.jump=sound.play(audio_abad_fall)
end
abad.step=abad.step+1
end
@@ -302,16 +302,16 @@ function abad_state_stairs()
if key.down(keyRight) or pad.down(btnRight) then
abad.flip=false
abad_advance()
playsnd(audio_low)
sound.play(audio_low)
elseif key.down(keyLeft) or pad.down(btnLeft) then
abad.flip=true
abad_advance()
playsnd(audio_low)
sound.play(audio_low)
elseif key.down(keyUp) or pad.down(btnUp) 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)
sound.play(audio_low)
end
else
abad.hab=abad.hab-10
@@ -322,7 +322,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)
sound.play(audio_low)
end
else
abad.hab=abad.hab+10