| Offline |
| Feejo Member |
 |
 |
Joined: Fri Mar 28, 2008 8:07 am Posts: 64
Location: Italy
|
|
Actually is very easy, if you see the game like a state machine. During run time your app is in a state (ie.say MENU_STATE). On user action the game change state (say MAIN_STATE).
The full logic is coded in the onmainloop() event. The following is the main loop of the Enlight Game from the example projects coming with FBA.
function onmainloop() if CURRENT_STATE == STATE_MENU then DoMenu() elseif CURRENT_STATE == STATE_PLAYING then DoGame() end DoStars() end
_________________ Regards, umbiomar [email protected]
|
|