Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables 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 (JAM_StateManager *stateManager, SDL_Renderer *renderer, int screenWidth, int screenHeight)
 
 ~Game ()
 
bool input ()
 
void update (float dt)
 
void draw ()
 
- Public Member Functions inherited from JAM_State
 JAM_State (JAM_StateManager *stateManager, SDL_Renderer *renderer, int screenWidth, int screenHeight)
 
virtual ~JAM_State ()
 

Private Member Functions

bool windowsInput (SDL_Event &incomingEvent)
 
bool androidInput (SDL_Event &incomingEvent)
 

Private Attributes

std::vector< JAM_Button * > buttons
 
JAM_Audiomusic
 
JAM_AudiosoundEffect
 
bool playing
 
std::vector< JAM_Text * > text
 

Additional Inherited Members

- Protected Attributes inherited from JAM_State
JAM_StateManagerstateManager
 
SDL_Renderer * renderer
 
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 ( JAM_StateManager stateManager,
SDL_Renderer *  renderer,
int  screenWidth,
int  screenHeight 
)

Constructs the Game object.

Parameters
stateManagerA pointer to the StateManager.
rendererA pointer to the renderer.
screenWidthThe screen width.
screenHeightThe screen height.

Here is the call graph for this function:

Game::~Game ( )

Destructs the Game object.

Here is the call graph for this function:

Member Function Documentation

bool Game::androidInput ( SDL_Event &  incomingEvent)
private

Handles the Android Game input.

Parameters
incomingEventA reference to the incoming SDL event.
Returns
If false then quit the Game State.

Here is the caller graph for this function:

void Game::draw ( )
virtual

A function to draw to the screen.

Implements JAM_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 JAM_State.

Here is the call graph for this function:

void Game::update ( float  dt)
virtual

A function to update the Game to allow the Game to run.

Parameters
dtThe delta time.

Implements JAM_State.

Here is the call graph for this function:

bool Game::windowsInput ( SDL_Event &  incomingEvent)
private

Handles the Windows Game input.

Parameters
incomingEventA reference to the incoming SDL event.
Returns
If false then quit the Game State.

Here is the caller graph for this function:

Member Data Documentation

std::vector<JAM_Button*> Game::buttons
private

The Buttons.

JAM_Audio* Game::music
private

A pointer to the background music.

bool Game::playing
private

A boolean value for if the music is playing.

JAM_Audio* Game::soundEffect
private

A pointer to the sound effect.

std::vector<JAM_Text*> Game::text
private

The Text.


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