Skip to content

Commit

Permalink
change: small adjusts in the ginga/launcher
Browse files Browse the repository at this point in the history
  • Loading branch information
RodrigoDornelles committed Jul 31, 2024
1 parent 26c28cf commit c439576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions examples/launcher/game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {}
Expand Down Expand Up @@ -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()
Expand Down
5 changes: 3 additions & 2 deletions src/engine/core/ginga/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -99,3 +99,4 @@ local function install(evt)
end

event.register(install)
return install

0 comments on commit c439576

Please sign in to comment.