00001 // --------------------------------------------------------------------------- 00002 // PLATFORM: All - 00003 // PRODUCT: Fourplay - 00004 // VISIBILITY: Public - 00005 // --------------------------------------------------------------------------- 00006 // - 00007 // PURPOSE: Game class which handles all updating, - 00008 // rendering, and game states. - 00009 // - 00010 // --------------------------------------------------------------------------- 00011 00012 #include "Iw2D.h" 00013 #include "Net.h" 00014 #include "ExtendedTutorial.h" 00015 #include "HttpHandler.h" 00016 #include "CInput.h" 00017 #include "Background.h" 00018 #include "MainMenu.h" 00019 #include "SinglePlayerMatch.h" 00020 #include "MultiplayerMatch.h" 00021 #include "HighScoreTable.h" 00022 #include "DifficultyMenu.h" 00023 00028 class Game 00029 { 00030 public: 00034 Game(); 00035 00039 ~Game(); 00040 00046 int Update(double deltaTime); 00047 00052 void Draw(double deltaTime); 00053 00054 protected: 00060 int UpdateMainMenu(double deltaTime); 00061 00066 void UpdateSinglePlayerGame(double deltaTime); 00067 00072 void UpdateMultiplayerGame(double deltaTime); 00073 00078 void UpdateTutorial(double deltaTime); 00079 00084 void UpdateHighscoreTable(double deltaTime); 00085 00090 void UpdateDifficultyMenu(double deltaTime); 00091 00095 void Fadeout(); 00096 00102 void Fadein(Menu *menu, 00103 double deltaTime); 00104 00110 void Fadein(Match *match, 00111 double deltaTime); 00112 00114 enum State { MENU, SINGLEPLAYING, MULTIPLAYING, TUTORIAL, HIGHSCORE, DIFFICULTY }; 00115 00117 State m_state; 00118 00120 Background *m_background; 00121 00123 MainMenu *m_mainMenu; 00124 00126 SinglePlayerMatch *m_singlePlayerMatch; 00127 00129 MultiplayerMatch *m_multiPlayerMatch; 00130 00132 ExtendedTutorial *m_tutorial; 00133 00135 HighScoreTable *m_highScoreTable; 00136 00138 DifficultyMenu *m_difficultyMenu; 00139 00141 CIw2DFont *m_font; 00142 00144 CIwFVec2 m_screenSize; 00145 00147 float startTime; 00148 00150 float matchTime; 00151 00153 static const int m_fadeSpeed = 10; 00154 };