diff --git a/examples/launcher/game.lua b/examples/launcher/game.lua index a3684bd..7e06cab 100644 --- a/examples/launcher/game.lua +++ b/examples/launcher/game.lua @@ -41,9 +41,6 @@ --! @cond local function next_state(game, new_state) - if game._state ~= new_state then - print(game._state, new_state) - end if game._state + 1 == new_state then game._state = new_state end @@ -71,7 +68,7 @@ end local function init(std, game) if not game._state then - game._state = 1 + game._state = 0 game._menu = 1 game._csv = '' game._list = {} @@ -114,7 +111,9 @@ local function http(std, game) end local function loop(std, game) - if game._state == 1 then + if game._state == 0 then + next_state(game, 1) + elseif game._state == 1 then halt_state(game)(function() next_state(game, 2) std.http.get('http://gh.dornelles.me/games.csv'):run() diff --git a/src/engine/core/ginga/main.lua b/src/engine/core/ginga/main.lua index d67137e..790ede3 100644 --- a/src/engine/core/ginga/main.lua +++ b/src/engine/core/ginga/main.lua @@ -47,7 +47,7 @@ local function fixed_loop() event.timer(delay, fixed_loop) end -local function install(evt) +local function install(evt, gamefile) if evt.class ~= 'ncl' or evt.action ~= 'start' then return end local ginga = { canvas=canvas, @@ -63,7 +63,7 @@ local function install(evt) time={1, 10, 30, 40, 60, 90} } - application = zeebo_module.loadgame() + application = zeebo_module.loadgame(gamefile) if not application then error('game not loaded!') end @@ -99,3 +99,4 @@ local function install(evt) end event.register(install) +return install