#include #include "main.h" #include "pad.h" #include "game.h" #include "menu.h" #include "play.h" static int prevstate; static int state; void initGame(void) { prevstate = GAME_MENU; state = GAME_MENU; initMenu(); } int updateGame(long padstate,long time) { prevstate = state; switch (state) { case GAME_MENU: state = updateMenu(padstate); break; case GAME_EXIT: return EXIT; break; case GAME_START: state = initPlay(getLevel(),time); break; case GAME_PLAY: state = updatePlay(padstate,time); break; case GAME_RESET: resetMenu(); state = GAME_MENU; break; } return OK; } void drawGame(GsOT* ot) { switch (prevstate) { case GAME_MENU: case GAME_EXIT: drawMenu(ot); break; case GAME_START: case GAME_PLAY: case GAME_RESET: drawPlay(ot); break; } }