Skip to content

Instantly share code, notes, and snippets.

@omgmog
Last active March 1, 2019 10:33
Show Gist options
  • Save omgmog/eec71d58540097a24fb146a4b96b2b69 to your computer and use it in GitHub Desktop.
Save omgmog/eec71d58540097a24fb146a4b96b2b69 to your computer and use it in GitHub Desktop.
function _init()
_upd=upd_title
_drw=drw_title
end
function _update()
_upd()
end
function _draw()
_drw()
end
-- title screen state update/draw functions
function upd_title()
-- change to game state when btn 4 is pressed
if btnp(4) then
_upd=upd_game
_drw=drw_game
end
end
function drw_title()
cls(1)
print("title")
end
-- game state update/draw functions
function upd_game()
-- some condition to determine the end of the game
if score < 1 then
_upd=upd_gameover
_drw=drw_gameover
end
end
function drw_game()
cls(2)
print("game")
end
-- gameover state update/draw functions
function upd_gameover()
end
function drw_gameover()
cls(3)
print("game over")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment