1 #ifndef _PUYOCOMMANDER 2 #define _PUYOCOMMANDER 3 4 #include "sofont.h" 5 #include "menu.h" 6 #include "scrollingtext.h" 7 #include "GameControls.h" 8 #include "PuyoDoomMelt.h" 9 10 #include "corona32.h" 11 #define CORONA_HEIGHT 120 12 13 class PuyoDrawable 14 { 15 public: 16 virtual void draw() = 0; 17 }; 18 19 class PuyoCommander 20 { 21 public: 22 PuyoCommander(bool fullscreen,bool sound, bool audio); 23 24 void run(); 25 void updateAll(PuyoDrawable *starter, SDL_Surface *extra_surf = NULL); 26 showGameOver()27 void showGameOver() { menu_show(gameOverMenu); } hideGameOver()28 void hideGameOver() { menu_hide(gameOverMenu); } 29 30 bool changeControlLoop(int controlIndex, PuyoDrawable *starter); 31 void controlsMenuLoop(PuyoDrawable *d); 32 void optionMenuLoop(PuyoDrawable *d = NULL); 33 void backLoop(Menu *menu, PuyoDrawable *starter = NULL); 34 void startSingleGameLoop(); 35 void startTwoPlayerGameLoop(); 36 void enterStringLoop(Menu *menu, const char *kItem, char out[256]); 37 38 Menu *gameOverMenu; 39 40 Menu *gameOver2PMenu; 41 Menu *gameOver1PMenu; 42 Menu *nextLevelMenu; 43 Menu *finishedMenu; 44 Menu *looserMenu; 45 Menu *highScoresMenu; 46 void updateHighScoresMenu(int newOne = -1); 47 48 SoFont *smallFont; 49 SoFont *darkFont; 50 SoFont *menuFont; 51 DoomMelt *melt; 52 53 private: 54 Menu *mainMenu; 55 Menu *singleGameMenu; 56 Menu *twoPlayerGameMenu; 57 Menu *optionMenu; 58 Menu *controlsMenu; 59 Menu *rulesMenu; 60 Menu *aboutMenu; 61 Menu *mustRestartMenu; 62 ScrollingText *scrollingText; 63 unsigned int cycle, start_time; 64 unsigned int lastRenderedCycle; 65 unsigned int maxFrameDrop; 66 67 static const int player1Joystick = 1; 68 static const int player2Joystick = 0; 69 70 int *corona_screen; 71 Corona32 *corona; 72 73 }; 74 75 76 extern SDL_Surface *display; 77 extern class PuyoCommander *theCommander; 78 79 extern char *kYouDidIt; 80 extern char *kNextLevel; 81 extern char *kLooser; 82 extern char *kCurrentLevel; 83 extern char *kContinueLeft; 84 extern char *kGameOver; 85 extern char *kYouGotToLevel; 86 extern char *kHitActionToContinue; 87 extern char *kContinue; 88 extern char *kPlayer; 89 extern char *kScore; 90 extern char *kContinueGame; 91 extern char *kAbortGame; 92 extern char *kOptions; 93 94 #endif // _PUYOCOMMANDER 95