From e0825e5bbb50f30183f02df4eccd9526fa839389 Mon Sep 17 00:00:00 2001 From: JailGamer Date: Fri, 29 May 2026 23:28:51 +0200 Subject: [PATCH] =?UTF-8?q?[WIP]=20Reestructurant=20codi=20abans=20de=20po?= =?UTF-8?q?sar-me=20en=20el=20nivell=202=20[NEW]=20Afegit=20music=5Fplayer?= =?UTF-8?q?=20[NEW]=20M=C3=BAsica=20de=20fons=20des=20de=20l'inici?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/abad.lua | 3 +- data/game.lua | 118 +++++++++++++++++++++++++++++---- data/game_over.lua | 3 +- data/intro.lua | 133 +++++++++++++++++++++++--------------- data/main.lua | 98 ++-------------------------- data/mapa.lua | 15 +++-- data/music_player.lua | 80 +++++++++++++++++++++++ data/opcions.lua | 3 +- data/remote_view.lua | 11 +++- data/requirements.lua | 31 +++++---- data/scenes.lua | 42 ++++++------ data/stage1.lua | 109 +++++++++++++++++-------------- data/stage1_ending.lua | 3 +- data/stage1_world_map.lua | 10 +-- data/stage2.lua | 27 ++++---- data/stage2_ending.lua | 3 +- data/stage_mgr.lua | 3 + data/states.lua | 41 ++++-------- data/title.lua | 3 +- data/trigger.lua | 5 ++ 20 files changed, 437 insertions(+), 304 deletions(-) create mode 100644 data/music_player.lua diff --git a/data/abad.lua b/data/abad.lua index b9ee80c..af82ead 100644 --- a/data/abad.lua +++ b/data/abad.lua @@ -169,7 +169,8 @@ function abad_hurt(howmuch) -- dead.start() -- music.play(audio_game_over,0) else - music.play(audio_life_lost,0) + -- music.play(audio_life_lost,0) + music_player:play(audio_life_lost,0,true) abad.energia=abad.max_energia -- abad.hab=abad.safe.hab -- abad.x=abad.safe.x diff --git a/data/game.lua b/data/game.lua index 8fefc16..a5f0537 100644 --- a/data/game.lua +++ b/data/game.lua @@ -1,3 +1,32 @@ +require "controller" +require "audio" +arcade_config = require("arcade_config") + +require "states" +require "requirements" +require "logo" +require "intro" +require "title" +require "opcions" +require "opcions_input" +require "pause" +require "game_over" +require "scenes" + +coords = require "coords" +require "helpers" +require "music_player" + +-- require "map" +require "mapa" +require "warp" +require "fade" + +require "point" + +require "fps" +--require "menu" + viewport= require("viewport") require "stage_mgr" require "abad" @@ -33,6 +62,80 @@ require "batvio" require "copter" require "sign" +font_default = font.current() + +function game_load() + surf.target(0) + surf.cls(16) + math.randomseed(os.time()) + mapa_surface_init() + states:executar("check-reqs") + controller:init() + fonts_init() + images_init() + fade.init() + audio_init() + logo_config(font_sf) +end + +function game_init(menu) + actors={} + abad_init() + table.insert(actors,abad) + score.create() + + stages.load_stage(true) + states:next() +end + +-- +-- Carregar fonts general del joc +-- +function fonts_init() + font_sf=font.load("X2_font.fnt") +end + +function images_init() + tiles=surf.load("tiles.gif") + surf.source(tiles) + local paleta=pal.load("tiles.gif") + pal.set(paleta) + tiles2=surf.load("tiles2.gif") + -- Crear el warp + warp.init(tiles) +end + +function image_close() + surf.free(tiles) + warp.close() +end + +function mapa_surface_init() + if (sf_mapa) then surf.free(sf_mapa) end + sf_mapa=surf.new(mapa_room_cols*mapa_rooms_per_piso,mapa_room_rows*mapa_pisos) +end + +function audio_init() + -- Càrrega dels audios + audio_text_abad = sound.load(audio_text_abad) + audio_text_premiere = sound.load(audio_text_premiere) + audio_text_elalien = sound.load(audio_text_elalien) + audio_text_batman = sound.load(audio_text_batman) + audio_text_imp = sound.load(audio_text_imp) + audio_abad_jump = sound.load(audio_abad_jump) + audio_abad_fall = sound.load(audio_abad_fall) + audio_abad_hit = sound.load(audio_abad_hit) + audio_abad_shot = sound.load(audio_abad_shot) + audio_abad_step[1] = sound.load(audio_abad_step[1]) + audio_abad_step[2] = sound.load(audio_abad_step[2]) + audio_abad_step[3] = sound.load(audio_abad_step[3]) + audio_abad_step[4] = audio_abad_step[2] + audio_switch = sound.load(audio_switch) + audio_hit = sound.load(audio_hit) + audio_low = sound.load(audio_low) +end + + local tile_w = arcade_config.tiles_width local tile_h = arcade_config.tiles_height local res_w = arcade_config.resolucion.width @@ -116,19 +219,6 @@ function game_exit() -- cameras={} end -function game_init(menu) --- print("GAME INIT") - actors={} - - abad_init() - table.insert(actors,abad) - - score.create() - - stages.load_stage(true) - states:next() -end - function render_map( sf_map, sf_tiles, x, y, target ) target = target or 0 map.surf(sf_map) @@ -232,6 +322,8 @@ end function update_game() surf.target(0) surf.cls(16) + + music_player:update() world_update() diff --git a/data/game_over.lua b/data/game_over.lua index 23a145d..91a7479 100644 --- a/data/game_over.lua +++ b/data/game_over.lua @@ -9,7 +9,8 @@ function game_over_init() dead.vel[i]=(200+math.random(0,399))/400 end -- game_update=dead.update - music.play(audio_game_over,0) + -- music.play(audio_game_over,0) + music_player:play(audio_game_over,0) states:next() end diff --git a/data/intro.lua b/data/intro.lua index 14b5583..42f4e38 100644 --- a/data/intro.lua +++ b/data/intro.lua @@ -1,73 +1,75 @@ -local abad={x=0,y=0,w=32,h=32,dx=88,dy=48,dw=32,dh=32} -local batman={x=0,y=96,w=32,h=32,dx=164,dy=48,dw=32,dh=32} -local cacaus={x=224,y=176,w=32,h=16,dx=152,dy=64,dw=32,dh=16} -local cacaus_trans={x=192,y=176,w=16,h=8,dx=65,dy=56,dw=16,dh=8} -local marc={x=30,y=6,w=198,h=102,color=2} -local pas_porta={x=146,y=48,w=14,h=32,color=16} + +local abad ={ x=0, y= 0, w=32, h=32, dx= 88, dy=48, dw=32, dh=32 } +local batman={ x=0, y= 96, w=32, h=32, dx=164, dy=48, dw=32, dh=32 } +local cacaus={ x=224, y=176, w=32, h=16, dx=152, dy=64, dw=32, dh=16 } +local cacaus_trans={ x=192, y=176, w=16, h=8, dx=65, dy=56, dw=16, dh=8 } +local marc={ x=30, y=6, w=198, h=102, color=2 } +local pas_porta={ x=146, y=48, w=14, h=32, color=16 } + local scene_x_offset = 32 local scene_y_offset = 8 -intro_wait=40 -intro_step=0 +local tiles_file = "tiles.gif" +local next_state = "title" -function draw_escenari () - surf.cls(16) - draw_item_intro("marc",false) - view.origin(scene_x_offset, scene_y_offset) - mapa_draw(10) - -- Borrar la porta del mapa - draw_item_intro("pas porta") -end +local intro_wait=40 +local intro_step=0 -function draw_item_intro( name, flip, mood ) - if ( name == "abad" ) then - -- abad.mood = mood or "normal" - draw.surf(abad.x, abad.y, abad.w, abad.h, abad.dx, abad.dy, abad.dw, abad.dh, flip) - abad_add_mood(abad.dx,0,abad.dy,0,flip,mood) - elseif (name == "batman" ) then - draw.surf(batman.x, batman.y, batman.w, batman.h, batman.dx, batman.dy, batman.dw, batman.dh, flip) - elseif (name == "cacaus" ) then - draw.surf(cacaus.x, cacaus.y, cacaus.w, cacaus.h, cacaus.dx, cacaus.dy, cacaus.dw, cacaus.dh, flip) - elseif (name == "cacaus trans" ) then - draw.surf(cacaus_trans.x, cacaus_trans.y, cacaus_trans.w, cacaus_trans.h, cacaus_trans.dx, cacaus_trans.dy, cacaus_trans.dw, cacaus_trans.dh, flip) - elseif (name == "marc" ) then - draw.rect(marc.x, marc.y, marc.w, marc.h, marc.color) - elseif (name == "pas porta" ) then - draw.rectf(pas_porta.x, pas_porta.y, pas_porta.w, pas_porta.h, pas_porta.color) - end -end +local intro_mapa_room_cols = 12; -- en quantitat de tiles +local intro_mapa_room_rows = 6; -- en quantitat de tiles +local intro_mapa_rooms_per_piso = 1 +local intro_mapa_pisos = 1 +local intro_mapa_empty_tile = 256 + +local intro_mapa={ + -- 1 + { + 256, 66, 26, 27, 28, 29, 28, 29, 26, 27, 28, 29, + 256,256,256, 24,256,256,256,256,256, 25,256,256, + 64, 68,256,256,256,256,256,256,256, 25,256,256, + 256,256, 66, 24,256,121,256,256,256, 38,256,256, + 256, 66,256, 24,101,102,103,256,256, 38,256,256, + 66,256,256, 24, 28, 29, 28, 29, 28, 29, 28, 29, + }, +} function intro_init() -print("INTRO_INIT") - -- game_update = intro_intro - mapa = stage1_mapa +-- print("INTRO_INIT") + mapa = intro_mapa + mapa_room_cols = intro_mapa_room_cols + mapa_room_rows = intro_mapa_room_rows + mapa_rooms_per_piso = intro_mapa_rooms_per_piso + mapa_pisos = intro_mapa_pisos + mapa_empty_tile = intro_mapa_empty_tile + mapa_surface_init() load_tilemap( sf_mapa ) + + tiles=surf.load(tiles_file) + surf.source(tiles) + local paleta=pal.load(tiles_file) + pal.set(paleta) intro_wait=400 - surf.source(tiles) surf.target(0) surf.cls(16) fade.fadein() font.current(font_sf) - -- flow:add_path({intro_intro, intro_update}) + states:next() end function intro_intro() +-- print("INTRO_INTRO") intro_wait=1 - -- game_update = intro_update states:next() fade.fadeoutin() end function intro_update() +-- print("INTRO_UPDATE") if key.press(key.ESCAPE) or pad.press(btnPause) then - -- game_init(true) - print("INTRO_UPDATE") - -- game_update = menu_init - -- game_init(true) - intro_end() + states:next() elseif key.press(key.SPACE) then intro_wait=1 end @@ -124,21 +126,50 @@ function intro_update() elseif intro_step==7 then start_scene(scenes.intro_04,58) intro_step=intro_step+1 - -- STEP 8 elseif intro_step==8 then - -- game_init(true) - -- game_update = menu_init - intro_end() + states:next() end intro_wait=50 end end function intro_end() - print("intro_end") +-- print("INTRO_END") fade.fadeoutin() - states:executar("title") + states:executar(next_state) end -states:registrar("intro", {intro_init, intro_intro, intro_update}) \ No newline at end of file +function draw_escenari () + surf.cls(16) + draw_item_intro("marc",false) + view.origin(scene_x_offset, scene_y_offset) + mapa_draw(0) + -- Borrar la porta del mapa + draw_item_intro("pas porta") +end + +function draw_item_intro( name, flip, mood ) + if ( name == "abad" ) then + draw.surf(abad.x, abad.y, abad.w, abad.h, abad.dx, abad.dy, abad.dw, abad.dh, flip) + abad_add_mood(abad.dx,0,abad.dy,0,flip,mood) + + elseif (name == "batman" ) then + draw.surf(batman.x, batman.y, batman.w, batman.h, batman.dx, batman.dy, batman.dw, batman.dh, flip) + + elseif (name == "cacaus" ) then + draw.surf(cacaus.x, cacaus.y, cacaus.w, cacaus.h, cacaus.dx, cacaus.dy, cacaus.dw, cacaus.dh, flip) + + elseif (name == "cacaus trans" ) then + draw.surf(cacaus_trans.x, cacaus_trans.y, cacaus_trans.w, cacaus_trans.h, cacaus_trans.dx, cacaus_trans.dy, cacaus_trans.dw, cacaus_trans.dh, flip) + + elseif (name == "marc" ) then + draw.rect(marc.x, marc.y, marc.w, marc.h, marc.color) + + elseif (name == "pas porta" ) then + draw.rectf(pas_porta.x, pas_porta.y, pas_porta.w, pas_porta.h, pas_porta.color) + end +end + + +states:registrar("intro", {intro_init, intro_intro, intro_update, intro_end}) diff --git a/data/main.lua b/data/main.lua index 1039b85..3e610e9 100644 --- a/data/main.lua +++ b/data/main.lua @@ -1,99 +1,7 @@ -arcade_config = require("arcade_config") -coords = require "coords" -require "helpers" -require "controller" -require "states" - --- require "map" -require "mapa" -require "warp" -require "fade" -require "audio" - -require "requirements" -require "logo" -require "intro" -require "scenes" -require "title" require "game" -require "opcions" -require "opcions_input" -require "pause" -require "game_over" - -require "point" - -require "fps" ---require "menu" - - -coords.set_config({ - tiles_width = arcade_config.tiles_width, - tiles_height = arcade_config.tiles_height, - room_cols = mapa_room_cols, - room_rows = mapa_room_rows, - rooms_per_floor = mapa_rooms_per_piso, -}) - -font_default = font.current() - -function images_init() - tiles=surf.load("tiles.gif") - surf.source(tiles) - local paleta=pal.load("tiles.gif") - pal.set(paleta) - tiles2=surf.load("tiles2.gif") - -- Crear el warp - warp.init(tiles) -end - -function image_close() - surf.free(tiles) - warp.close() -end - -function fonts_init() - font_sf=font.load("X2_font.fnt") -end - -function mapa_init() - sf_mapa=surf.new(mapa_room_cols*mapa_rooms_per_piso,mapa_room_rows*mapa_pisos) - -- load_tilemap( sf_mapa ) -end - -function audio_init() - -- Càrrega dels audios - audio_text_abad = sound.load(audio_text_abad) - audio_text_premiere = sound.load(audio_text_premiere) - audio_text_elalien = sound.load(audio_text_elalien) - audio_text_batman = sound.load(audio_text_batman) - audio_text_imp = sound.load(audio_text_imp) - audio_abad_jump = sound.load(audio_abad_jump) - audio_abad_fall = sound.load(audio_abad_fall) - audio_abad_hit = sound.load(audio_abad_hit) - audio_abad_shot = sound.load(audio_abad_shot) - audio_abad_step[1] = sound.load(audio_abad_step[1]) - audio_abad_step[2] = sound.load(audio_abad_step[2]) - audio_abad_step[3] = sound.load(audio_abad_step[3]) - audio_abad_step[4] = audio_abad_step[2] - audio_switch = sound.load(audio_switch) - audio_hit = sound.load(audio_hit) - audio_low = sound.load(audio_low) -end function mini.init() - -- back_sf=surf.new(256,192) - math.randomseed(os.time()) - fonts_init() - images_init() - mapa_init() - fade.init() - audio_init() - controller:init() - logo_config(font_sf) - surf.target(0) - surf.cls(16) - states:executar("check-reqs") + game_load() end function mini.update() @@ -107,7 +15,9 @@ function mini.update() win.cursor(fs) end - if (game_update) then game_update() end + if (game_update) then + game_update() + end -- Pausa per a que vaja be en mini 1.5.1 -- local t0 = os.clock() diff --git a/data/mapa.lua b/data/mapa.lua index 1339dfe..186efda 100644 --- a/data/mapa.lua +++ b/data/mapa.lua @@ -5,6 +5,12 @@ mapa={} mapa.wait=0 mapa.step=0 +mapa_room_cols = 0 +mapa_room_rows = 0 +mapa_rooms_per_piso = 0 +mapa_pisos = 0 +mapa_empty_tile = 0 + half_block_set={ [20] = true, [21] = true, [22] = true, [28] = true, @@ -97,11 +103,12 @@ function arc_mapa_update() end end + function mapa_draw(hab) - for ty=0,5 do - for tx=0,11 do - local tile=mapa[1+hab][1+tx+ty*12] - if tile~=256 and (tile<126 or mapa.step>4) then + for ty=0,mapa_room_rows-1 do + for tx=0,mapa_room_cols-1 do + local tile=mapa[1+hab][1+tx+ty*mapa_room_cols] + if tile~=mapa_empty_tile and (tile<126 or mapa.step>4) then -- draw.surf((tile&15)*8,64+(tile>>4)*8,8,8,tx*8,ty*8) local txr = arcade_config.tiles_per_row-1 local txr2 = arcade_config.tiles_per_row_base2 diff --git a/data/music_player.lua b/data/music_player.lua new file mode 100644 index 0000000..7052969 --- /dev/null +++ b/data/music_player.lua @@ -0,0 +1,80 @@ +music_info = { + mus_life_ogg = 1.6 +} + +music_player = { + playlist = {song="", pos=0}, + song = "", + playing = false, + pos = 0, + old_pos = 0, + check_time = 0, +} + +function music_player:play(song, loop, enqueue) +-- print("MUSIC_PLAYER:PLAY "..song) + if enqueue then + self.playlist.song = self.song + self.playlist.pos = music.pos() + end + -- print( os.clock()) + if loop~=nil then + music.play(song, loop) + else + music.play(song) + end + -- print( os.clock()) + self.song = song + -- self.old_pos = music.pos() + self.playing = true + self.check_time = os.clock() +end + + +function music_player:pause() + music.pause() +end + + +function music_player:resume() + music.resume() +end + + +function music_player:stop() + music.stop() +end + + +function music_player:pos() + music.pos() +end + + +function music_player:enabled() + music.enabled() +end + +function music_player:update() + -- self.pos = music.pos() + local curr_time = os.clock() + local song_name = self.song:gsub("%.", "_") + if music_info[song_name]~=nil and curr_time-self.check_time>music_info[song_name] then + -- print("MUSIC_PLAYER:UPDATE "..self.pos.." / "..self.old_pos.." / "..music.pos()) + -- if self.pos==self.old_pos then self.playing = false end + self.playing = false + self.old_pos = self.pos + self.check_time = curr_time + end + + if not self.playing and self.playlist.song~="" then + self.song = self.playlist.song + self.pos = self.playlist.pos + -- print( os.clock()) + music.play(self.song) + -- print( os.clock()) + -- music.pos(self.pos) + self.playlist.song = "" + self.playlist.pos = 0 + end +end \ No newline at end of file diff --git a/data/opcions.lua b/data/opcions.lua index 7f1a553..d69f991 100644 --- a/data/opcions.lua +++ b/data/opcions.lua @@ -21,7 +21,8 @@ function opcions_update() if key.press(keyShoot) or key.press(key.SPACE) or pad.press(pad.A) or pad.press(btnShoot) or key.press(key.RETURN) then if menu_sel==0 then music.enabled(not music.enabled()) - if music.enabled() then music.play(audio_main_song) end + -- if music.enabled() then music.play(audio_main_song) end + if music.enabled() then music_player:play(audio_main_song) end elseif menu_sel==1 then sound.enabled(not sound.enabled()) elseif menu_sel==2 then diff --git a/data/remote_view.lua b/data/remote_view.lua index 16e97df..714ea75 100644 --- a/data/remote_view.lua +++ b/data/remote_view.lua @@ -1,21 +1,25 @@ remote_view_wait = 0 remote_view_hab = "" -remote_sf_w = mapa_room_cols*arcade_config.tiles_width -remote_sf_h = mapa_room_rows*arcade_config.tiles_height +remote_sf_w = 0 +remote_sf_h = 0 function remote_view_init () + remote_sf_w = mapa_room_cols*arcade_config.tiles_width + remote_sf_h = mapa_room_rows*arcade_config.tiles_height sf_remote=surf.new(remote_sf_w, remote_sf_h) end function remote_view(hab) +-- print("REMOTE_VIEW "..hab) remote_view_hab = hab remote_view_wait = 200 end function remote_view_draw() if remote_view_wait>0 then + -- print("REMOTE_VIEW_DRAW "..remote_view_hab) local x,y = coords.room_to_coord ( remote_view_hab ) - + -- print("X,Y= "..x.." , "..y) local curr_source = surf.source() local curr_target = surf.target() @@ -30,6 +34,7 @@ function remote_view_draw() surf.source(sf_remote) draw.surf(0,0,remote_sf_w,remote_sf_h,11,11,(remote_sf_w/2)-2,(remote_sf_h/2)-2) draw.rect(10,10,(remote_sf_w/2),(remote_sf_h/2),2) + -- print("RSW,RSH= "..remote_sf_w.." , "..remote_sf_h) surf.source(curr_source) remote_view_wait = remote_view_wait-1 end diff --git a/data/requirements.lua b/data/requirements.lua index 325ad93..24d5380 100644 --- a/data/requirements.lua +++ b/data/requirements.lua @@ -1,6 +1,7 @@ local mini_version = "" local versio_req = {1,5,0} local parts = {} +local printed = false function reqs_init() local version=sys.version() @@ -16,32 +17,34 @@ end function reqs_draw() -- print("LOGO DRAW "..logo_step) - -- Seleccionar font i destí - -- surf.source(logo_sf) surf.target(0) - -- Netejar destí surf.cls(16) - draw.text("Es requerix mini "..table.concat(versio_req, "."),20,20,2) - draw.text("Executant amb mini "..table.concat(parts, "."),20,30,2) + local str1 = "Es requerix mini "..table.concat(versio_req, ".") + local str2 = "Executant amb mini "..table.concat(parts, ".") + draw.text(str1,20,20,2) + draw.text(str2,20,30,2) + if not printed then + print(str1) + print(str2) + printed = true + end end function reqs_end() -- print("LOGO_END") - -- game_update = intro_init states:executar("logo") - -- surf.free(logo_sf) end function reqs_update() - if parts[1]>versio_req[1] then - states:next() - elseif parts[2]>versio_req[2] then - states:next() - elseif parts[3]>=versio_req[3] then - states:next() - else + if parts[1] STEP= "..self.step.." / "..#self.path) --- if self.sub_path_enable then --- print("> SUB_PATH_ENABLE= TRUE") --- else --- print("> SUB_PATH_ENABLE= FALSE") --- end --- print("> SUB_STEP= "..self.sub_step.." / "..#self.sub_path) --- print("") --- end states={ registre={}, -- {nom {ptr (a l'estat actual), path (llista de funcions ordenada)} ...} @@ -40,7 +18,8 @@ end function states:registrar(nom, _path) print("[STATES] REGISTRAR => "..nom) self.registre[nom]= {ptr=0, path=_path} - print(self.registre[nom].ptr) + -- print(" nom.ptr -> "..self.registre[nom].ptr) + -- print(" nom.path -> "..#self.registre[nom].path) end function states:borrar(nom) @@ -68,22 +47,24 @@ function states:executar(nom, stacking) end self.actiu=nom self.registre[self.actiu].ptr=0 + -- Executar el primer pas self:next() end function states:next() - print("[STATES] NEXT "..self.actiu); - local ptr = self.registre[self.actiu].ptr - local steps = #self.registre[self.actiu].path --- print("STATES_NEXT= "..self.actiu..", "..ptr..", "..steps) + -- print("[STATES] NEXT "..self.actiu); + local estat = self.registre[self.actiu] + local ptr = estat.ptr + local steps = #estat.path if ptr+1>steps then self:finish() else - self.registre[self.actiu].ptr = ptr+1 - game_update = self.registre[self.actiu].path[self.registre[self.actiu].ptr] + estat.ptr = ptr+1 + -- print("[STATES] NEXT "..self.actiu.." ("..estat.ptr.." / "..steps..")") + game_update = estat.path[estat.ptr] end - return self.actiu, self.registre[self.actiu].ptr + return self.actiu, estat.ptr end function states:finish() diff --git a/data/title.lua b/data/title.lua index 3fd031c..db2a65e 100644 --- a/data/title.lua +++ b/data/title.lua @@ -32,7 +32,8 @@ local rect_wait = 0 function title_init() title_sf=surf.load("title_tiles.gif") surf.source(title_sf) - music.play(audio_main_song) + -- music.play(audio_main_song) + music_player:play(audio_main_song) states:next() end diff --git a/data/trigger.lua b/data/trigger.lua index 543a8a5..d8d43c9 100644 --- a/data/trigger.lua +++ b/data/trigger.lua @@ -93,6 +93,11 @@ function triggers:add_1up() triggers.open_door(self) end +function triggers:start_bg_music() + stages.stage_bg_music() + remove_actor(self) +end + function triggers:escena_abad_inici() start_scene(scenes.abad_inici) remove_actor(self)