2011-04-22 15:49:46 +02:00
|
|
|
-- menu state
|
|
|
|
function onEnterMenuState()
|
2011-05-01 20:47:35 +02:00
|
|
|
mainMenu = UI.load("modules/mainmenu/mainmenu.yml")
|
2011-04-22 15:49:46 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function onLeaveMenuState()
|
2011-04-23 02:12:28 +02:00
|
|
|
mainMenu:destroy()
|
2011-04-22 15:49:46 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function onApplicationClose()
|
|
|
|
onLeaveMenuState()
|
|
|
|
exitGame()
|
|
|
|
end
|
|
|
|
|
|
|
|
-- here is where everything starts
|
|
|
|
if not initialStateLoaded then
|
|
|
|
onEnterMenuState()
|
2011-05-01 20:47:35 +02:00
|
|
|
App.setOnClose(onApplicationClose)
|
2011-04-22 15:49:46 +02:00
|
|
|
initialStateLoaded = true
|
2011-05-01 20:47:35 +02:00
|
|
|
end
|