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

View File

@@ -79,7 +79,7 @@ function bambolla.update_normal()
end end
bambolla.y=28-math.abs(math.sin(bambolla.x*0.1))*24 bambolla.y=28-math.abs(math.sin(bambolla.x*0.1))*24
if bambolla.hab==abad.hab and bambolla.y>25.2 then if bambolla.hab==abad.hab and bambolla.y>25.2 then
playsnd(audio_low) sound.play(audio_low)
end end
if bambolla.hab==abad.hab then if bambolla.hab==abad.hab then
if cacau.hab==bambolla.hab and aabb(bambolla,cacau) then if cacau.hab==bambolla.hab and aabb(bambolla,cacau) then
@@ -89,7 +89,7 @@ function bambolla.update_normal()
bambolla.y=bambolla.y+8 bambolla.y=bambolla.y+8
bambolla.dx=0 bambolla.dx=0
bambolla.dy=-4 bambolla.dy=-4
playsnd(audio_hit) sound.play(audio_hit)
end end
if aabb(bambolla,abad) then if aabb(bambolla,abad) then
abad_hurt(1) abad_hurt(1)

View File

@@ -8,7 +8,7 @@ function final_init()
abad.update = abad_nop abad.update = abad_nop
game_update=update_final game_update=update_final
next_actor() next_actor()
playmus(audio_final) music.play(audio_final)
local r,g,b=pal.color(15) local r,g,b=pal.color(15)
pal.color(17,r,g,b) pal.color(17,r,g,b)
--fade.fadein() --fade.fadein()
@@ -33,15 +33,6 @@ function update_final()
mapa_update(abad.hab,final_room) mapa_update(abad.hab,final_room)
if key.press(key.M) then
mute = not mute
if mute then
music.stop()
else
playmus(audio_final)
end
end
if go_next_actor then next_actor() end if go_next_actor then next_actor() end
end end
@@ -141,14 +132,6 @@ function update_final2()
text("C A C A U S", 42, 12, 17) text("C A C A U S", 42, 12, 17)
text("GRACIES PER JUGAR", 30, 48, 10) text("GRACIES PER JUGAR", 30, 48, 10)
if key.press(key.M) then
mute = not mute
if mute then
music.stop()
else
playmus(audio_final)
end
end
final_count=final_count+1 final_count=final_count+1
if final_count==200 or (key.press(keyShoot) or pad.press(btnShoot)) or key.press(key.RETURN) then if final_count==200 or (key.press(keyShoot) or pad.press(btnShoot)) or key.press(key.RETURN) then
game_exit() game_exit()

View File

@@ -28,7 +28,6 @@ actors={}
cameras={} cameras={}
camera_names={[0]="GPS","Gorro","Peu de Paco","Premiere","EL_ALIEN","BatMan"} camera_names={[0]="GPS","Gorro","Peu de Paco","Premiere","EL_ALIEN","BatMan"}
current_camera=0 current_camera=0
mute=false
function remove_actor(actor) function remove_actor(actor)
for index, value in pairs(actors) do for index, value in pairs(actors) do
@@ -38,19 +37,6 @@ function remove_actor(actor)
end end
end end
function playmus(song,loop)
if not mute then
music.play(song,loop)
end
end
function playsnd(snd,volume)
if not mute then
--print(sound)
return sound.play(snd,volume)
end
end
function game_init(menu) function game_init(menu)
actors={} actors={}
cameras={} cameras={}
@@ -151,13 +137,13 @@ function game_init(menu)
if menu then if menu then
menu_sel=0 menu_sel=0
menu_state=0 menu_state=update_main_menu;
abad.update = abad_nop abad.update = abad_nop
game_update=update_menu game_update=update_menu
menu_count=0 menu_count=0
menu_change_room=300 menu_change_room=300
menu_room=math.random(0,59) menu_room=math.random(0,59)
playmus(audio_main_song) music.play(audio_main_song)
else else
game_update=update_game game_update=update_game
music.stop() music.stop()
@@ -296,24 +282,6 @@ function update_game()
fireball.update() fireball.update()
switches.update() switches.update()
--local hx = abad.hab%10
--local hy = math.floor(abad.hab/10)
--if btnp(KEY_RETURN) then
-- mode=modes.editing
-- mapa_restore_backup()
--elseif btn(KEY_LSHIFT) and btnp(KEY_RIGHT) and hx<9 then
-- abad.hab=abad.hab+1
--elseif btn(KEY_LSHIFT) and btnp(KEY_LEFT) and hx>0 then
-- abad.hab=abad.hab-1
--elseif btn(KEY_LSHIFT) and btnp(KEY_DOWN) and hy<7 then
-- abad.hab=abad.hab+10
--elseif btn(KEY_LSHIFT) and btnp(KEY_UP) and hy>0 then
-- abad.hab=abad.hab-10
--elseif btnp(KEY_M) then
-- mute = not mute
--elseif btnp(KEY_ESCAPE) then
-- pause()
--end
if key.press(key.ESCAPE) or pad.press(btnPause) then if key.press(key.ESCAPE) or pad.press(btnPause) then
pause() pause()
end end
@@ -371,159 +339,206 @@ function update_menu()
surf.cls(16) surf.cls(16)
text("C A C A U S", 42, 8, 15) text("C A C A U S", 42, 8, 15)
if menu_state == 0 then menu_state()
menu_count=menu_count+1 end
local parpadeig=false
if menu_count>=20 then
parpadeig=true
if menu_count>40 then menu_count=0 end
end
if (not parpadeig or menu_sel~=0) then text("JUGAR", 54, 16, 13) end
if (not parpadeig or menu_sel~=1) then text("REDEFINIR TECLAT", 32, 24, 13) end
if (not parpadeig or menu_sel~=2) then text("REDEFINIR GAMEPAD", 30, 32, 13) end
redraw_menu_hab() function update_options_menu()
menu_count=menu_count+1
local parpadeig=false
if menu_count>=20 then
parpadeig=true
if menu_count>40 then menu_count=0 end
end
draw.rect(28,28+(10*menu_sel),73,9,14)
if (not parpadeig) then draw.rect(28,28+(10*menu_sel),73,9,13) end
if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) then draw.text("MÚSICA", 30, 30, 14); draw.text(music.enabled() and "SI" or "NO",91,30,15)
if menu_sel==0 then draw.text("", 30, 40, 14); draw.text(sound.enabled() and "SI" or "NO",91,40,15)
game_exit() draw.text("REDEFINIR TECLAT", 30, 50, 14)
game_init() draw.text("REDEFINIR GAMEPAD", 30, 60, 14)
fade.fadeoutin() draw.text("TORNAR", 30, 70, 14)
elseif menu_sel==1 then
menu_count=0 if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) then
menu_state=1 if menu_sel==0 then
else music.enabled(not music.enabled())
menu_count=0 if music.enabled() then music.play(audio_main_song) end
menu_state=2 elseif menu_sel==1 then
end sound.enabled(not sound.enabled())
elseif key.press(keyDown) or key.press(key.DOWN) or pad.press(pad.DOWN) or pad.press(btnDown) then elseif menu_sel==2 then
menu_sel=menu_sel+1 menu_count=0
if menu_sel==3 then menu_sel=0 end menu_state=update_redefine_keys_menu
elseif key.press(keyUp) or key.press(key.UP) or pad.press(pad.UP) or pad.press(btnUp) then elseif menu_sel==3 then
menu_sel=menu_sel-1 menu_count=0
if menu_sel==-1 then menu_sel=2 end menu_state=update_redefine_pad_menu
elseif key.press(key.M) then else
mute = not mute menu_count=0
if mute then menu_sel=0
music.stop() menu_state=update_main_menu
else
playmus(audio_main_song)
end
elseif key.press(key.ESCAPE) or pad.press(btnPause) then
sys.quit()
end end
elseif menu_state==1 then elseif key.press(keyDown) or key.press(key.DOWN) or pad.press(pad.DOWN) or pad.press(btnDown) then
if key.press(key.ESCAPE) then menu_sel=menu_sel+1
if menu_sel==5 then menu_sel=0 end
elseif key.press(keyUp) or key.press(key.UP) or pad.press(pad.UP) or pad.press(btnUp) then
menu_sel=menu_sel-1
if menu_sel==-1 then menu_sel=4 end
elseif key.press(key.ESCAPE) or pad.press(btnPause) then
menu_count=0
menu_sel=0
menu_state=update_main_menu
end
end
function update_main_menu()
menu_count=menu_count+1
local parpadeig=false
if menu_count>=20 then
parpadeig=true
if menu_count>40 then menu_count=0 end
end
draw.rect(28,18+(10*menu_sel),73,9,14)
if (not parpadeig) then draw.rect(28,18+(10*menu_sel),73,9,13) end
text("JUGAR", 54, 20, 14)
text("OPCIONS", 50, 30, 14)
--if (not parpadeig or menu_sel~=2) then text("REDEFINIR GAMEPAD", 30, 32, 13) end
redraw_menu_hab()
if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) then
if menu_sel==0 then
game_exit()
game_init()
fade.fadeoutin()
elseif menu_sel==1 then
menu_count=0
menu_sel=0
menu_state=update_options_menu--update_redefine_keys_menu;
else
menu_count=0
menu_state=update_redefine_pad_menu
end
elseif key.press(keyDown) or key.press(key.DOWN) or pad.press(pad.DOWN) or pad.press(btnDown) then
menu_sel=menu_sel+1
if menu_sel==2 then menu_sel=0 end
elseif key.press(keyUp) or key.press(key.UP) or pad.press(pad.UP) or pad.press(btnUp) then
menu_sel=menu_sel-1
if menu_sel==-1 then menu_sel=1 end
elseif key.press(key.ESCAPE) or pad.press(btnPause) then
sys.quit()
end
end
function update_redefine_keys_menu()
if key.press(key.ESCAPE) then
menu_count = 0
menu_state = update_options_menu;
end
if menu_count==0 then
text("PULSA TECLA PER A AMUNT", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 1
keyUp=k
config.key("keyup", keyUp)
end
elseif menu_count==1 then
text("PULSA TECLA PER A AVALL", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 2
keyDown=k
config.key("keydown", keyDown)
end
elseif menu_count==2 then
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 3
keyLeft=k
config.key("keleft", keyLeft)
end
elseif menu_count==3 then
text("PULSA TECLA PER A DRETA", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 4
keyRight=k
config.key("keyright", keyRight)
end
elseif menu_count==4 then
text("PULSA TECLA PER A BOTAR", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 5
keyJump=k
config.key("keyjump", keyJump)
end
elseif menu_count==5 then
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 0 menu_count = 0
menu_state = 0 menu_state = update_options_menu;
end keyShoot=k
if menu_count==0 then config.key("keyshoot", keyShoot)
text("PULSA TECLA PER A AMUNT", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 1
keyUp=k
config.key("keyup", keyUp)
end
elseif menu_count==1 then
text("PULSA TECLA PER A AVALL", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 2
keyDown=k
config.key("keydown", keyDown)
end
elseif menu_count==2 then
text("PULSA TECLA PER A ESQUERRA", 14, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 3
keyLeft=k
config.key("keleft", keyLeft)
end
elseif menu_count==3 then
text("PULSA TECLA PER A DRETA", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 4
keyRight=k
config.key("keyright", keyRight)
end
elseif menu_count==4 then
text("PULSA TECLA PER A BOTAR", 20, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 5
keyJump=k
config.key("keyjump", keyJump)
end
elseif menu_count==5 then
text("PULSA TECLA PER A DISPAR", 18, 24, 13)
local k = key.press();
if k ~= 0 and k~=key.ESCAPE then
menu_count = 0
menu_state = 0
keyShoot=k
config.key("keyshoot", keyShoot)
end
end
else
if key.press(key.ESCAPE) then
menu_count = 0
menu_state = 0
end
if menu_count==0 then
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 1
btnUp=btn
config.key("btnup", btnUp)
end
elseif menu_count==1 then
text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 2
btnDown=btn
config.key("btndown", btnDown)
end
elseif menu_count==2 then
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 3
btnLeft=btn
config.key("keleft", btnLeft)
end
elseif menu_count==3 then
text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 4
btnRight=btn
config.key("btnright", btnRight)
end
elseif menu_count==4 then
text("PULSA BOTÓ PER A BOTAR", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 5
btnJump=btn
config.key("btnjump", btnJump)
end
elseif menu_count==5 then
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 0
menu_state = 0
btnShoot=btn
config.key("btnshoot", btnShoot)
end
end end
end end
end
function update_redefine_pad_menu()
if key.press(key.ESCAPE) then
menu_count = 0
menu_state = update_options_menu;
end
if menu_count==0 then
text("PULSA BOTÓ PER A AMUNT", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 1
btnUp=btn
config.key("btnup", btnUp)
end
elseif menu_count==1 then
text("PULSA BOTÓ PER A AVALL", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 2
btnDown=btn
config.key("btndown", btnDown)
end
elseif menu_count==2 then
text("PULSA BOTÓ PER A ESQUERRA", 16, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 3
btnLeft=btn
config.key("keleft", btnLeft)
end
elseif menu_count==3 then
text("PULSA BOTÓ PER A DRETA", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 4
btnRight=btn
config.key("btnright", btnRight)
end
elseif menu_count==4 then
text("PULSA BOTÓ PER A BOTAR", 22, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 5
btnJump=btn
config.key("btnjump", btnJump)
end
elseif menu_count==5 then
text("PULSA BOTÓ PER A DISPAR", 20, 24, 13)
local btn = pad.press();
if btn ~= -1 then
menu_count = 0
menu_state = update_options_menu;
btnShoot=btn
config.key("btnshoot", btnShoot)
end
end
end end
function game_exit() function game_exit()
@@ -550,28 +565,55 @@ end
function update_pause() function update_pause()
draw.rectf(16,16,97,65,16) draw.rectf(16,16,97,65,16)
draw.rect(16,16,97,65,15) draw.rect(16,16,97,65,15)
draw.text("PAUSA",54,30,15) draw.text("PAUSA",54,20,15)
if pausa_option==1 then
draw.rect(28,48,73,9,13) menu_count=menu_count+1
else local parpadeig=false
draw.rect(28,58,73,9,13) if menu_count>=20 then
parpadeig=true
if menu_count>40 then menu_count=0 end
end end
draw.text("CONTINUAR",30,50,14) draw.rect(28,33+(10*(pausa_option-1)),73,9,14)
draw.text("EIXIR",30,60,14) if (not parpadeig) then draw.rect(28,33+(10*(pausa_option-1)),73,9,13) end
--draw.rect(28,33+(10*(pausa_option-1)),73,9,13)
draw.text("CONTINUAR",30,35,14)
draw.text("MUSICA:",30,45,14)
if music.enabled() then
draw.text("SI",91,45,15)
else
draw.text("NO",91,45,15)
end
draw.text("SÓ:",30,55,14)
if sound.enabled() then
draw.text("SI",91,55,15)
else
draw.text("NO",91,55,15)
end
draw.text("EIXIR",30,65,14)
if key.press(key.ESCAPE) then if key.press(key.ESCAPE) then
surf.source(back) surf.source(back)
draw.surf(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
surf.source(tiles) surf.source(tiles)
game_update = pause_old_update game_update = pause_old_update
elseif key.press(keyDown) or key.press(keyUp) or pad.press(btnDown) or pad.press(btnUp) then elseif key.press(keyDown) or pad.press(btnDown) then
if pausa_option==1 then pausa_option=2 else pausa_option=1 end pausa_option = pausa_option + 1
if pausa_option == 5 then pausa_option = 1 end
elseif key.press(keyUp) or pad.press(btnUp) then
pausa_option = pausa_option - 1
if pausa_option == 0 then pausa_option = 4 end
elseif key.press(keyShoot) or pad.press(btnShoot) then elseif key.press(keyShoot) or pad.press(btnShoot) then
if pausa_option==1 then if pausa_option==1 then
surf.source(back) surf.source(back)
draw.surf(0,0,128,96,0,0) draw.surf(0,0,128,96,0,0)
surf.source(tiles) surf.source(tiles)
game_update = pause_old_update game_update = pause_old_update
elseif pausa_option==2 then
music.enabled(not music.enabled())
elseif pausa_option==3 then
sound.enabled(not sound.enabled())
else else
game_exit() game_exit()
game_init(true) game_init(true)

View File

@@ -22,7 +22,7 @@ function gota:update_normal()
self.cx=self.x+2 self.cx=self.x+2
self.dx=0 self.dx=0
self.dy=-4 self.dy=-4
if self.hab==abad.hab then playsnd(audio_low) end if self.hab==abad.hab then sound.play(audio_low) end
end end
else else
--self.flip=not self.flip --self.flip=not self.flip

View File

@@ -73,7 +73,7 @@ function imp.update()
imp.x=imp.x-2 imp.x=imp.x-2
if imp.x==78 then if imp.x==78 then
fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
playsnd(audio_hit) sound.play(audio_hit)
imp.flip=not imp.flip imp.flip=not imp.flip
elseif imp.x==-12 then elseif imp.x==-12 then
imp.reset() imp.reset()
@@ -82,7 +82,7 @@ function imp.update()
imp.x=imp.x+2 imp.x=imp.x+2
if imp.x==4 then if imp.x==4 then
fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip)
playsnd(audio_hit) sound.play(audio_hit)
imp.flip=not imp.flip imp.flip=not imp.flip
elseif imp.x==92 then elseif imp.x==92 then
imp.reset() imp.reset()

View File

@@ -29,9 +29,6 @@ function intro_intro()
game_update = intro_update game_update = intro_update
fade.fadeoutin() fade.fadeoutin()
end end
if key.press(key.M) then
mute = not mute
end
end end
function intro_update() function intro_update()
@@ -40,8 +37,6 @@ function intro_update()
fade.fadeoutin() fade.fadeoutin()
elseif key.press(key.SPACE) then elseif key.press(key.SPACE) then
intro_wait=1 intro_wait=1
elseif key.press(key.M) then
mute = not mute
end end
intro_wait=intro_wait-1 intro_wait=intro_wait-1
@@ -97,7 +92,7 @@ function intro_update()
start_scene(scenes.intro_04,58) start_scene(scenes.intro_04,58)
intro_step=intro_step+1 intro_step=intro_step+1
elseif intro_step==8 then elseif intro_step==8 then
playmus(audio_main_song) music.play(audio_main_song)
game_init(true) game_init(true)
fade.fadeoutin() fade.fadeoutin()
end end

View File

@@ -144,7 +144,7 @@ function start_scene(scene,offset)
scenes.die=scenes.current_scene[scenes.dnum].die or 0 scenes.die=scenes.current_scene[scenes.dnum].die or 0
if scene[1].musica then if scene[1].musica then
--print(scene[1].musica) --print(scene[1].musica)
playmus(scenes.current_scene[scenes.dnum].musica) music.play(scenes.current_scene[scenes.dnum].musica)
end end
if offset then scenes.offset=offset end if offset then scenes.offset=offset end
old_update=game_update old_update=game_update
@@ -153,13 +153,13 @@ end
function playtext(snd) function playtext(snd)
if snd=="abad" then if snd=="abad" then
playsnd(audio_text_abad) sound.play(audio_text_abad)
elseif snd=="batman" then elseif snd=="batman" then
playsnd(audio_text_batman) sound.play(audio_text_batman)
elseif snd=="premiere" then elseif snd=="premiere" then
playsnd(audio_text_premiere) sound.play(audio_text_premiere)
elseif snd=="elalien" then elseif snd=="elalien" then
playsnd(audio_text_elalien) sound.play(audio_text_elalien)
end end
end end
@@ -281,8 +281,6 @@ function update_scene()
else else
pause() pause()
end end
elseif key.press(key.M) then
mute = not mute
end end
if scenes.step>8 then if scenes.step>8 then

View File

@@ -24,7 +24,7 @@ function switches.start(hab,tile)
switches.current_index=2 switches.current_index=2
switches.wait=0 switches.wait=0
switches.cooldown=60 switches.cooldown=60
playsnd(audio_switch) sound.play(audio_switch)
end end
function switches.update() function switches.update()

View File

@@ -71,7 +71,7 @@ end
function triggers:teleport_a() function triggers:teleport_a()
abad.teleport=true abad.teleport=true
playsnd(audio_hit) sound.play(audio_hit)
surf.cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=67 abad.hab=67
@@ -80,7 +80,7 @@ end
function triggers:teleport_b() function triggers:teleport_b()
if abad.teleport then if abad.teleport then
playsnd(audio_hit) sound.play(audio_hit)
surf.cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=14 abad.hab=14
@@ -90,7 +90,7 @@ end
function triggers:teleport_c() function triggers:teleport_c()
abad.teleport2=true abad.teleport2=true
playsnd(audio_hit) sound.play(audio_hit)
surf.cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=61 abad.hab=61
@@ -99,7 +99,7 @@ end
function triggers:teleport_d() function triggers:teleport_d()
if abad.teleport2 then if abad.teleport2 then
playsnd(audio_hit) sound.play(audio_hit)
surf.cls(14) surf.cls(14)
imp.reset() imp.reset()
abad.hab=29 abad.hab=29