diff --git a/data/game.lua b/data/game.lua index 173bc50..3126a22 100644 --- a/data/game.lua +++ b/data/game.lua @@ -27,7 +27,7 @@ require "batman" require "health_potion" require "tiles_layer2" require "batvio" -require "live_scene" +-- require "live_scene" local DEBUG = false diff --git a/data/live_scene.lua b/data/live_scene.lua deleted file mode 100644 index 7778370..0000000 --- a/data/live_scene.lua +++ /dev/null @@ -1,42 +0,0 @@ -live_scene = { - --scene_update = nil, - --scene_end = nil, -} - --- function live_scene.scene_update() --- -- buida --- end --- --- function live_scene.scene_end() --- -- buida --- end - -function live_scene.update_stage1_ending() - stage1_ending:update_scene() -end - -function live_scene.end_stage1_ending() - stage1_ending:end_scene() -end - -function live_scene.start( name, op ) - local flow_name = "live_scene_"..name - local update_func = live_scene["update_"..name] - local end_func = live_scene["end_"..name] - --live_scene.scene_update = update_func - --live_scene.scene_end = end_func - print("LIVE SCENE START") - if op=="add" then - print("ADD") - flow:registrar(flow_name,{update_func,end_func}) - flow:add(flow_name); - else - print("EXEC") - flow:executar("live_scene", true); - end -end - -flow:registrar("live_scene",{ - live_scene.scene_update, - live_scene.scene_end -}) \ No newline at end of file diff --git a/data/scenes.lua b/data/scenes.lua index a60e1d0..3894b86 100644 --- a/data/scenes.lua +++ b/data/scenes.lua @@ -164,6 +164,13 @@ scenes={ {x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"Si vols els cacaus","hauràs d'agarrar-me", ""},die=20}, {x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",text={"I mes te val no tardar","perque estan bonissims", "Torradets en el seu punt"},die=20}, }, + stage1_ending_2={ + {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"elalien!","Premiere!","Que feu ací!?"},die=20}, + {x=avatar_elalien_x,y=avatar_elalien_y,flip=true,audio="elalien",text={"HAVEM VIST COM","FUGIA BATMAN", "EN ELS CACAUS!!"},die=20}, + {x=avatar_premiere_x,y=avatar_premiere_y,flip=true,audio="premiere",text={"Porca miseria!!","Il batmano e molto duri", "...Un momenti"},die=20}, + {x=avatar_premiere_x,y=avatar_premiere_y,flip=true,audio="premiere",text={"Io tingo un artiluggio","per volare d'un gran", "mio amichi"},die=20}, + {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"OH! MOLTES GRACIES","PREMIERE!!!",""},die=20}, + }, final= { {x=avatar_batman_x,y=avatar_batman_y,flip=true,audio="batman",musica=audio_song_batman,text={"AI!", "M'has fet mal!!!",""},die=20}, {x=avatar_abad_x,y=avatar_abad_y,flip=false,audio="abad",text={"Aixó per furtar-me","el bol de cacaus,","imbèsil"},die=20}, diff --git a/data/stage1_ending.lua b/data/stage1_ending.lua index f945e4e..0c533eb 100644 --- a/data/stage1_ending.lua +++ b/data/stage1_ending.lua @@ -1,13 +1,18 @@ stage1_ending ={ time = 0, - batvio_vx = 1 + batvio_vx = 1, + update = function(self) + stage1_ending:update_scene() + end } -function stage1_ending:update_scene () +function stage1_ending.update_scene(self) print("UPDATING "..self.time) - -- primera escena - batman escapa - if self.time<120 then + if self.time==0 then + start_scene(scenes.stage1_ending, nil, false) + -- segona escena - batman escapa + elseif self.time<120 then batvio.x = batvio.x - self.batvio_vx if self.time % 6 == 0 then self.batvio_vx= self.batvio_vx+1 @@ -18,12 +23,14 @@ function stage1_ending:update_scene () premiere.stage1_ending_init() elalien.stage1_ending_init() elseif self.time<250 then + -- tercera escena - Aparició de elalien i premiere + -- elalien 9,1,3 -> 8,6,3 + -- premiere 7,6,3 -> 8,1,3 premiere.update() elalien.update() - -- segona escena - Aparició de elalien i premiere - -- elalien 9,0,3 -> 8,6,3 - -- premiere 7,6,3 -> 8,1,3 - elseif self.time<300 then + elseif self.time==250 then + start_scene(scenes.stage1_ending_2, nil, false) + elseif self.time<400 then end @@ -35,12 +42,17 @@ function stage1_ending:update_scene () self.time = self.time + 1 -- Acabar ending - if self.time>=250 then + if self.time>=350 then flow:next() end end -function stage1_ending:end_scene() +function stage1_ending.end_scene() print("END") flow:finish() -end \ No newline at end of file +end + +flow:registrar("stage1_ending",{ + stage1_ending.update, + stage1_ending.end_scene +}) \ No newline at end of file diff --git a/data/trigger.lua b/data/trigger.lua index 600123d..4b6ff94 100644 --- a/data/trigger.lua +++ b/data/trigger.lua @@ -146,8 +146,9 @@ function triggers:escena_stage1_ending() print("STAGE 1 ENDING") -- abad.update = abad_nop remove_actor(self) - live_scene.start("stage1_ending", "add") - start_scene(scenes.stage1_ending, nil, false) + flow:executar("stage1_ending", true) + -- live_scene.start("stage1_ending", "add") + -- start_scene(scenes.stage1_ending, nil, false) end function triggers:escena_lluita_imp()