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