Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes

Game Class Reference

Game class. More...

#include <Game.h>

List of all members.

Public Member Functions

 Game ()
 ~Game ()
int Update (double deltaTime)
void Draw (double deltaTime)

Protected Types

enum  State {
  MENU, SINGLEPLAYING, MULTIPLAYING, TUTORIAL,
  HIGHSCORE, DIFFICULTY
}
 

Possible gamestates.


Protected Member Functions

int UpdateMainMenu (double deltaTime)
void UpdateSinglePlayerGame (double deltaTime)
void UpdateMultiplayerGame (double deltaTime)
void UpdateTutorial (double deltaTime)
void UpdateHighscoreTable (double deltaTime)
void UpdateDifficultyMenu (double deltaTime)
void Fadeout ()
void Fadein (Menu *menu, double deltaTime)
void Fadein (Match *match, double deltaTime)

Protected Attributes

State m_state
 The current gamestate.
Backgroundm_background
 The game's background.
MainMenum_mainMenu
 The game's main menu.
SinglePlayerMatchm_singlePlayerMatch
 A singleplayer match.
MultiplayerMatchm_multiPlayerMatch
 A multiplayer match.
ExtendedTutorialm_tutorial
 A tutorial.
HighScoreTablem_highScoreTable
 The highscore table.
DifficultyMenum_difficultyMenu
 Difficulty selection menu.
CIw2DFont * m_font
 Font for drawing text to the screen.
CIwFVec2 m_screenSize
 Screen dimensions (in pixels).
float startTime
 Start time of the match (in ms).
float matchTime
 Duration of the match.

Static Protected Attributes

static const int m_fadeSpeed = 10
 Speed for fading during scene transitions.

Detailed Description

Game class.

Game class which controls game states, updates, and rendering.


Constructor & Destructor Documentation

Game::Game (  ) 

Constructor.

Create a new game.

Game::~Game (  ) 

Destructor.

Destroy the game and release all associated memory.


Member Function Documentation

void Game::Draw ( double  deltaTime  ) 

Draw.

Render the game.

Parameters:
[in] deltaTime Time since the last update.
void Game::Fadein ( Menu menu,
double  deltaTime 
) [protected]

Fade in.

Fade in effect for gamestate changes (renders a menu derivitive in the background).

Parameters:
[in] menu The menu to be drawn during the fade transition.
[in] deltaTime Time since the last update.
void Game::Fadein ( Match match,
double  deltaTime 
) [protected]

Fade in.

Fade in effect for gamestate changes (renders a match derivitive in the background).

Parameters:
[in] match The match to be drawn during the fade transition.
[in] deltaTime Time since the last update.
void Game::Fadeout (  )  [protected]

Fadout.

Fadeout effect for gamestate changes.

int Game::Update ( double  deltaTime  ) 

Update.

Updates whichever state the game is currently in (playing, menu, tutorial, etc).

Parameters:
[in] deltaTime Time since the last update.
Returns:
int represents whether the player has quit the game in the main menu.
void Game::UpdateDifficultyMenu ( double  deltaTime  )  [protected]

Update difficulty menu.

Updates the "choose difficulty" menu and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.
void Game::UpdateHighscoreTable ( double  deltaTime  )  [protected]

Update highscore table.

Updates a highscore table and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.
int Game::UpdateMainMenu ( double  deltaTime  )  [protected]

Update main menu.

Updates the main menu and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.
Returns:
int represents whether the player has quit the game.
void Game::UpdateMultiplayerGame ( double  deltaTime  )  [protected]

Update multiplayer games.

Updates a multiplayer game and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.
void Game::UpdateSinglePlayerGame ( double  deltaTime  )  [protected]

Update singleplayer games.

Updates a singleplayer game and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.
void Game::UpdateTutorial ( double  deltaTime  )  [protected]

Update tutorial.

Updates a tutorial and sets the new gamestate depending on player input (if any).

Parameters:
[in] deltaTime Time since the last update.

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations