[NEW] Mòdul Live scene per a escenes de joc

[NEW] Modificat mòdul flow per a poder afegir registres que no se van a executar inmediatament i així programar escenes encadenades
This commit is contained in:
2026-05-09 22:31:11 +02:00
parent 6a555a55f2
commit 83720a8b69
6 changed files with 77 additions and 27 deletions
+44
View File
@@ -0,0 +1,44 @@
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()
print("UPDATING")
flow:next()
end
function live_scene.end_stage1_ending()
print("END")
flow:finish()
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
})