Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Game Class Reference

Creates an Game object that inherits State and runs the Game. More...

#include <Game.h>

Inheritance diagram for Game:
Inheritance graph
Collaboration diagram for Game:
Collaboration graph

Public Member Functions

 Game (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 
 ~Game ()
 
bool input ()
 
void update (float dt)
 
void draw ()
 
- Public Member Functions inherited from State
 State (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 
virtual ~State ()
 
SDL_Window * getWindow ()
 

Private Member Functions

void loadingScreen ()
 
void resetGame ()
 

Private Attributes

std::unordered_map
< std::string, Object * > 
objects
 
std::unordered_map
< std::string, Shader * > 
shaders
 
Audiomusic
 
AudioringPassed
 
AudioringMissed
 
std::vector< Ring * > targetRings
 
Playerplayer
 
Groundchapel
 
Groundhouse
 
Groundground
 
Cameracamera
 
GameUIuserInterface
 
float height
 
float score
 
int initialLoops
 
ParticleEffectreachedEndEffect
 
float timeSinceEnd
 
bool ended
 

Additional Inherited Members

- Protected Attributes inherited from State
StateManagerstateManager
 
SDL_Window * window
 
int screenWidth
 
int screenHeight
 

Detailed Description

Creates an Game object that inherits State and runs the Game.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

Game::Game ( StateManager stateManager,
SDL_Window *  window,
int  screenWidth,
int  screenHeight 
)

Constructs a Game object.

Parameters
stateManagerA pointer to the StateManager.
windowA pointer to the window.
screenWidthThe screen width.
screenHeightThe screen height.

Here is the call graph for this function:

Game::~Game ( )

Destructs an Game object.

Here is the call graph for this function:

Member Function Documentation

void Game::draw ( )
virtual

A function to draw to the screen.

Implements State.

Here is the call graph for this function:

bool Game::input ( )
virtual

Handles the Game input.

Returns
If false then quit the Game State.

Implements State.

Here is the call graph for this function:

void Game::loadingScreen ( )
private

Draws a LoadingScreen.

Here is the call graph for this function:

Here is the caller graph for this function:

void Game::resetGame ( )
private

Reset the Game.

Here is the call graph for this function:

Here is the caller graph for this function:

void Game::update ( float  dt)
virtual

A function to update the Game.

Parameters
dtThe delta time.

Implements State.

Here is the call graph for this function:

Member Data Documentation

Camera* Game::camera
private

The Camera for the Game

Ground* Game::chapel
private

The Chapel Entity

bool Game::ended
private

If the game has ended

Ground* Game::ground
private
float Game::height
private

The height that the Player is from the Ground.

Ground* Game::house
private

The house Entity

int Game::initialLoops
private

A int for the number of initial loops before the game should update

Audio* Game::music
private

The background music

std::unordered_map<std::string, Object*> Game::objects
private

The loaded Object files

Player* Game::player
private
ParticleEffect* Game::reachedEndEffect
private

A ParticleEffect for when the player passes the last ring

Audio* Game::ringMissed
private

The sound effect for missing the rings

Audio* Game::ringPassed
private

The sound effect for passing the rings

float Game::score
private

The score of the Player. Lowest score is best. Score increases with time and decreases when a ring is gone through.

std::unordered_map<std::string, Shader*> Game::shaders
private
std::vector<Ring*> Game::targetRings
private

A vector of the target Ring objects

float Game::timeSinceEnd
private

The time since the player reached the end

GameUI* Game::userInterface
private

The GameUI


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