From 8019332de1bf43576d4fb0d7f4099c24b7b9b185 Mon Sep 17 00:00:00 2001 From: JailDoctor Date: Thu, 12 Jan 2023 20:03:41 +0100 Subject: [PATCH] =?UTF-8?q?-=20Implementat=20el=20teleport=20desde=20l'hab?= =?UTF-8?q?itaci=C3=B3=20secreta=20;)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game.lua | 7 +++++-- scenes.lua | 2 +- trigger.lua | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/game.lua b/game.lua index e808216..7e8fe2e 100644 --- a/game.lua +++ b/game.lua @@ -29,7 +29,7 @@ end function playsnd(sound,volume) if not mute then --print(sound) - playsound(sound,volume) + return playsound(sound,volume) end end @@ -115,8 +115,11 @@ function game_init(menu) table.insert(actors,trigger.new(56,32,32,triggers.escena_abad_porta_batman)) table.insert(actors,trigger.new(19,32,32,triggers.escena_habitacio_batman)) - score.create() + table.insert(actors,trigger.new(14,40,32,triggers.teleport_a)) + table.insert(actors,trigger.new(67,8,32,triggers.teleport_b)) + score.create() + cameras[0]=gps table.insert(cameras,gorro) table.insert(cameras,peu) diff --git a/scenes.lua b/scenes.lua index 603bc75..a852f56 100644 --- a/scenes.lua +++ b/scenes.lua @@ -141,7 +141,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, 64) + playmus(scenes.current_scene[scenes.dnum].musica) end if offset then scenes.offset=offset end old_update=_update diff --git a/trigger.lua b/trigger.lua index 2e11d38..95e175e 100644 --- a/trigger.lua +++ b/trigger.lua @@ -68,3 +68,22 @@ function triggers:escena_habitacio_batman() end end end + +function triggers:teleport_a() + abad.teleport=true + playsnd(audio_hit) + cls(14) + imp.reset() + abad.hab=67 + abad.x=24 +end + +function triggers:teleport_b() + if abad.teleport then + playsnd(audio_hit) + cls(14) + imp.reset() + abad.hab=14 + abad.x=16 + end +end