From 639fd6e34db91a31487d58c7d69d2df873c2277f Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Thu, 30 Oct 2025 16:31:07 +0100 Subject: [PATCH] =?UTF-8?q?-=20Passat=20a=20mini=20v1.3.7=20-=20[NEW]=20ar?= =?UTF-8?q?a=20es=20pot=20activar=20i=20desactivar=20el=20s=C3=B3,=20des?= =?UTF-8?q?=20del=20nou=20menu=20d'opcions=20i=20desde=20el=20menu=20in-ga?= =?UTF-8?q?me=20-=20[NEW]=20menus=20canviats=20un=20poc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/abad.lua | 26 +-- data/bambolla.lua | 4 +- data/final.lua | 19 +-- data/game.lua | 420 +++++++++++++++++++++++++--------------------- data/gota.lua | 2 +- data/imp.lua | 4 +- data/intro.lua | 7 +- data/scenes.lua | 12 +- data/switches.lua | 2 +- data/trigger.lua | 8 +- 10 files changed, 261 insertions(+), 243 deletions(-) diff --git a/data/abad.lua b/data/abad.lua index 82cd18b..7ded7f5 100644 --- a/data/abad.lua +++ b/data/abad.lua @@ -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 diff --git a/data/bambolla.lua b/data/bambolla.lua index 71639bc..6dbf480 100644 --- a/data/bambolla.lua +++ b/data/bambolla.lua @@ -79,7 +79,7 @@ function bambolla.update_normal() end bambolla.y=28-math.abs(math.sin(bambolla.x*0.1))*24 if bambolla.hab==abad.hab and bambolla.y>25.2 then - playsnd(audio_low) + sound.play(audio_low) end if bambolla.hab==abad.hab 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.dx=0 bambolla.dy=-4 - playsnd(audio_hit) + sound.play(audio_hit) end if aabb(bambolla,abad) then abad_hurt(1) diff --git a/data/final.lua b/data/final.lua index 50a90be..797baf2 100644 --- a/data/final.lua +++ b/data/final.lua @@ -8,7 +8,7 @@ function final_init() abad.update = abad_nop game_update=update_final next_actor() - playmus(audio_final) + music.play(audio_final) local r,g,b=pal.color(15) pal.color(17,r,g,b) --fade.fadein() @@ -33,15 +33,6 @@ function update_final() 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 end @@ -141,14 +132,6 @@ function update_final2() text("C A C A U S", 42, 12, 17) 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 if final_count==200 or (key.press(keyShoot) or pad.press(btnShoot)) or key.press(key.RETURN) then game_exit() diff --git a/data/game.lua b/data/game.lua index 145d4ee..46d2a13 100644 --- a/data/game.lua +++ b/data/game.lua @@ -28,7 +28,6 @@ actors={} cameras={} camera_names={[0]="GPS","Gorro","Peu de Paco","Premiere","EL_ALIEN","BatMan"} current_camera=0 -mute=false function remove_actor(actor) for index, value in pairs(actors) do @@ -38,19 +37,6 @@ function remove_actor(actor) 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) actors={} cameras={} @@ -151,13 +137,13 @@ function game_init(menu) if menu then menu_sel=0 - menu_state=0 + menu_state=update_main_menu; abad.update = abad_nop game_update=update_menu menu_count=0 menu_change_room=300 menu_room=math.random(0,59) - playmus(audio_main_song) + music.play(audio_main_song) else game_update=update_game music.stop() @@ -296,24 +282,6 @@ function update_game() fireball.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 pause() end @@ -371,159 +339,206 @@ function update_menu() surf.cls(16) text("C A C A U S", 42, 8, 15) - if menu_state == 0 then - 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 - 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 + menu_state() +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 - if menu_sel==0 then - game_exit() - game_init() - fade.fadeoutin() - elseif menu_sel==1 then - menu_count=0 - menu_state=1 - else - menu_count=0 - menu_state=2 - 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==3 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=2 end - elseif key.press(key.M) then - mute = not mute - if mute then - music.stop() - else - playmus(audio_main_song) - end - elseif key.press(key.ESCAPE) or pad.press(btnPause) then - sys.quit() + draw.text("MÚSICA", 30, 30, 14); draw.text(music.enabled() and "SI" or "NO",91,30,15) + draw.text("SÓ", 30, 40, 14); draw.text(sound.enabled() and "SI" or "NO",91,40,15) + draw.text("REDEFINIR TECLAT", 30, 50, 14) + draw.text("REDEFINIR GAMEPAD", 30, 60, 14) + draw.text("TORNAR", 30, 70, 14) + + if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) then + if menu_sel==0 then + music.enabled(not music.enabled()) + if music.enabled() then music.play(audio_main_song) end + elseif menu_sel==1 then + sound.enabled(not sound.enabled()) + elseif menu_sel==2 then + menu_count=0 + menu_state=update_redefine_keys_menu + elseif menu_sel==3 then + menu_count=0 + menu_state=update_redefine_pad_menu + else + menu_count=0 + menu_sel=0 + menu_state=update_main_menu end - elseif menu_state==1 then - if key.press(key.ESCAPE) then + 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==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_state = 0 - 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_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 + menu_state = update_options_menu; + keyShoot=k + config.key("keyshoot", keyShoot) 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 function game_exit() @@ -550,28 +565,55 @@ end function update_pause() draw.rectf(16,16,97,65,16) draw.rect(16,16,97,65,15) - draw.text("PAUSA",54,30,15) - if pausa_option==1 then - draw.rect(28,48,73,9,13) - else - draw.rect(28,58,73,9,13) + draw.text("PAUSA",54,20,15) + + 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.text("CONTINUAR",30,50,14) - draw.text("EIXIR",30,60,14) + draw.rect(28,33+(10*(pausa_option-1)),73,9,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 surf.source(back) draw.surf(0,0,128,96,0,0) surf.source(tiles) game_update = pause_old_update - elseif key.press(keyDown) or key.press(keyUp) or pad.press(btnDown) or pad.press(btnUp) then - if pausa_option==1 then pausa_option=2 else pausa_option=1 end + elseif key.press(keyDown) or pad.press(btnDown) then + 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 if pausa_option==1 then surf.source(back) draw.surf(0,0,128,96,0,0) surf.source(tiles) 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 game_exit() game_init(true) diff --git a/data/gota.lua b/data/gota.lua index f3aa312..e34a148 100644 --- a/data/gota.lua +++ b/data/gota.lua @@ -22,7 +22,7 @@ function gota:update_normal() self.cx=self.x+2 self.dx=0 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 else --self.flip=not self.flip diff --git a/data/imp.lua b/data/imp.lua index 3af9b18..0825b58 100644 --- a/data/imp.lua +++ b/data/imp.lua @@ -73,7 +73,7 @@ function imp.update() imp.x=imp.x-2 if imp.x==78 then fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) - playsnd(audio_hit) + sound.play(audio_hit) imp.flip=not imp.flip elseif imp.x==-12 then imp.reset() @@ -82,7 +82,7 @@ function imp.update() imp.x=imp.x+2 if imp.x==4 then fireball.init(imp.hab,imp.x+8,imp.y+4,imp.flip) - playsnd(audio_hit) + sound.play(audio_hit) imp.flip=not imp.flip elseif imp.x==92 then imp.reset() diff --git a/data/intro.lua b/data/intro.lua index 24aa370..d9fddbb 100644 --- a/data/intro.lua +++ b/data/intro.lua @@ -29,9 +29,6 @@ function intro_intro() game_update = intro_update fade.fadeoutin() end - if key.press(key.M) then - mute = not mute - end end function intro_update() @@ -40,8 +37,6 @@ function intro_update() fade.fadeoutin() elseif key.press(key.SPACE) then intro_wait=1 - elseif key.press(key.M) then - mute = not mute end intro_wait=intro_wait-1 @@ -97,7 +92,7 @@ function intro_update() start_scene(scenes.intro_04,58) intro_step=intro_step+1 elseif intro_step==8 then - playmus(audio_main_song) + music.play(audio_main_song) game_init(true) fade.fadeoutin() end diff --git a/data/scenes.lua b/data/scenes.lua index 25b5d03..9a5bfdd 100644 --- a/data/scenes.lua +++ b/data/scenes.lua @@ -144,7 +144,7 @@ function start_scene(scene,offset) scenes.die=scenes.current_scene[scenes.dnum].die or 0 if scene[1].musica then --print(scene[1].musica) - playmus(scenes.current_scene[scenes.dnum].musica) + music.play(scenes.current_scene[scenes.dnum].musica) end if offset then scenes.offset=offset end old_update=game_update @@ -153,13 +153,13 @@ end function playtext(snd) if snd=="abad" then - playsnd(audio_text_abad) + sound.play(audio_text_abad) elseif snd=="batman" then - playsnd(audio_text_batman) + sound.play(audio_text_batman) elseif snd=="premiere" then - playsnd(audio_text_premiere) + sound.play(audio_text_premiere) elseif snd=="elalien" then - playsnd(audio_text_elalien) + sound.play(audio_text_elalien) end end @@ -281,8 +281,6 @@ function update_scene() else pause() end - elseif key.press(key.M) then - mute = not mute end if scenes.step>8 then diff --git a/data/switches.lua b/data/switches.lua index b017149..f83b303 100644 --- a/data/switches.lua +++ b/data/switches.lua @@ -24,7 +24,7 @@ function switches.start(hab,tile) switches.current_index=2 switches.wait=0 switches.cooldown=60 - playsnd(audio_switch) + sound.play(audio_switch) end function switches.update() diff --git a/data/trigger.lua b/data/trigger.lua index 67d6509..882ae17 100644 --- a/data/trigger.lua +++ b/data/trigger.lua @@ -71,7 +71,7 @@ end function triggers:teleport_a() abad.teleport=true - playsnd(audio_hit) + sound.play(audio_hit) surf.cls(14) imp.reset() abad.hab=67 @@ -80,7 +80,7 @@ end function triggers:teleport_b() if abad.teleport then - playsnd(audio_hit) + sound.play(audio_hit) surf.cls(14) imp.reset() abad.hab=14 @@ -90,7 +90,7 @@ end function triggers:teleport_c() abad.teleport2=true - playsnd(audio_hit) + sound.play(audio_hit) surf.cls(14) imp.reset() abad.hab=61 @@ -99,7 +99,7 @@ end function triggers:teleport_d() if abad.teleport2 then - playsnd(audio_hit) + sound.play(audio_hit) surf.cls(14) imp.reset() abad.hab=29