Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

Game Class Reference

Contains the game objects, updates the logic, and draws entities. More...

#include <Game.h>

List of all members.

Public Methods

 Game ()
 Constructor.

 ~Game ()
 Destructor.

void update (float dt)
 Updates the game logic.

void draw ()
 Draws all game objects.

bool control (float dt)
 Control all the game objects.

MapgetMap () const
 Get the current map.

void addEntity (Entity *e)
 Add an entity to the game.

void addController (Controller *c)
 Add a controller to the game.

void addLogic (GameLogic *g)
 Add a GameLogic to the game.

void addEffect (Effect *e)
 Add an Effect to the game.

bool startNewGame (int mapNum)
 Starts a new game.

void resetMap ()
 Sets a flag so that the Map will restart the game completely anew at the start of the next update call.


Detailed Description

Contains the game objects, updates the logic, and draws entities.


Constructor & Destructor Documentation

Game::Game  
 

Constructor.

Game::~Game  
 

Destructor.


Member Function Documentation

void Game::addController Controller   c
 

Add a controller to the game.

Control will automatically be read from the controller each iteration of the game loop.

Parameters:
c  the controller to add

void Game::addEffect Effect   e
 

Add an Effect to the game.

The object will be updated each iteration of the game loop.

Parameters:
e  the Effect to add

void Game::addEntity Entity   e
 

Add an entity to the game.

The entity will automatically be drawn and updated every iteration of the game loop.

Parameters:
e  the entity to add

void Game::addLogic GameLogic   g
 

Add a GameLogic to the game.

The object will be updated each iteration of the game loop.

Parameters:
g  the logic to add

bool Game::control float    dt
 

Control all the game objects.

Parameters:
the  amount of time since the last frame
Returns:
true if it is time to exit the game

void Game::draw  
 

Draws all game objects.

Todo:
map->draw: need to find viewport size instead of hardcoding.

Map * Game::getMap  
 

Get the current map.

Returns:
the current map

void Game::resetMap  
 

Sets a flag so that the Map will restart the game completely anew at the start of the next update call.

bool Game::startNewGame int    mapNum
 

Starts a new game.

The parameter is the number of the map file in the maps directory to use for the game (ex: 0 would load maps/map0.map).

Parameters:
number  of the map file
Returns:
true if the map load failed.

void Game::update float    dt
 

Updates the game logic.

Parameters:
dt  the difference in time since last update
Returns:
true if it is time to exit the game


The documentation for this class was generated from the following files:
Generated on Tue Mar 4 02:29:26 2003 for SuperIsoBomb by doxygen1.2.18