Caseus Tower
 All Classes Namespaces Files Functions Variables
Game Class Reference

Creates an Game object Creates an Game object which inherits State. More...

#include <game.h>

Inheritance diagram for Game:
State

Public Member Functions

 Game (StateManager *, SpriteHandler *, int, int)
 
 ~Game ()
 
void update (float, float, float)
 
void drawSprites ()
 
void drawSpritesWithAlpha ()
 
- Public Member Functions inherited from State
 State (StateManager *, SpriteHandler *, int, int)
 
virtual ~State ()
 
std::string GetStateName ()
 
bool runProgram ()
 

Private Member Functions

void displayScore ()
 
void generatePlatforms (float)
 

Private Attributes

Audiomusic
 
AudiojumpSafe
 
AudiojumpDanger
 
std::vector< Entity * > background
 
std::vector< Entity * > safePlatforms
 
std::vector< Entity * > dangerPlatforms
 
EntitypauseButton
 
EntityplayButton
 
EntityexitButton
 
Playerplayer
 
std::vector< Animation * > platformAnim
 
AnimationbuttonPress
 
AnimationplayerAnim
 
int pauseSprite
 
int playSprite
 
int exitSprite
 
int score
 
int highestScore
 
float gravity
 
bool pressed
 

Additional Inherited Members

- Protected Attributes inherited from State
StateManagerstateManager
 
int screenWidth
 
int screenHeight
 
SpriteHandlersprites
 
std::string name
 
bool runCheck
 

Detailed Description

Creates an Game object Creates an Game object which inherits State.

Definition at line 17 of file game.h.

Constructor & Destructor Documentation

Game::Game ( StateManager ,
SpriteHandler ,
int  ,
int   
)

Constructs a Game object

Parameters
StateManager* a pointer to the StateManager
SpriteHandler*a pointer to the SpriteHandler.
intthe screen width.
intthe screen height.
Game::~Game ( )

A destructor for the Game object

Member Function Documentation

void Game::displayScore ( )
private

Draws the score to the screen

void Game::drawSprites ( )
virtual

A function for displaying the Sprite objects which do not use alpha.

Implements State.

void Game::drawSpritesWithAlpha ( )
virtual

A function for displaying the Sprite objects which do use alpha.

Implements State.

void Game::generatePlatforms ( float  )
private

Generates the new platforms Generates a new row of random platforms

Parameters
floatthe x position
void Game::update ( float  ,
float  ,
float   
)
virtual

A function for updating the Game object

Parameters
floatthe delta time
floatthe x touch location
floatthe y touch location

Implements State.

Member Data Documentation

std::vector<Entity *> Game::background
private

The Game entities

Definition at line 25 of file game.h.

Animation* Game::buttonPress
private

Definition at line 34 of file game.h.

std::vector<Entity *> Game::dangerPlatforms
private

Definition at line 27 of file game.h.

Entity* Game::exitButton
private

Definition at line 30 of file game.h.

int Game::exitSprite
private

Definition at line 39 of file game.h.

float Game::gravity
private

The gravity

Definition at line 44 of file game.h.

int Game::highestScore
private

Definition at line 42 of file game.h.

Audio* Game::jumpDanger
private

Definition at line 23 of file game.h.

Audio* Game::jumpSafe
private

Definition at line 22 of file game.h.

Audio* Game::music
private

Audio

Definition at line 21 of file game.h.

Entity* Game::pauseButton
private

Definition at line 28 of file game.h.

int Game::pauseSprite
private

Animation indexes

Definition at line 37 of file game.h.

std::vector<Animation *> Game::platformAnim
private

Animation objects

Definition at line 33 of file game.h.

Entity* Game::playButton
private

Definition at line 29 of file game.h.

Player* Game::player
private

Definition at line 31 of file game.h.

Animation* Game::playerAnim
private

Definition at line 35 of file game.h.

int Game::playSprite
private

Definition at line 38 of file game.h.

bool Game::pressed
private

boolean for if a button is pressed

Definition at line 46 of file game.h.

std::vector<Entity *> Game::safePlatforms
private

Definition at line 26 of file game.h.

int Game::score
private

The players score

Definition at line 41 of file game.h.


The documentation for this class was generated from the following file: