Creates an Game object that inherits State and runs the Game. More...
#include <Game.h>
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 |
Audio * | music |
Audio * | ringPassed |
Audio * | ringMissed |
std::vector< Ring * > | targetRings |
Player * | player |
Ground * | chapel |
Ground * | house |
Ground * | ground |
Camera * | camera |
GameUI * | userInterface |
float | height |
float | score |
int | initialLoops |
ParticleEffect * | reachedEndEffect |
float | timeSinceEnd |
bool | ended |
Additional Inherited Members | |
Protected Attributes inherited from State | |
StateManager * | stateManager |
SDL_Window * | window |
int | screenWidth |
int | screenHeight |
Game::Game | ( | StateManager * | stateManager, |
SDL_Window * | window, | ||
int | screenWidth, | ||
int | screenHeight | ||
) |
Constructs a Game object.
stateManager | A pointer to the StateManager. |
window | A pointer to the window. |
screenWidth | The screen width. |
screenHeight | The screen height. |
Game::~Game | ( | ) |
|
virtual |
|
virtual |
|
private |
Draws a LoadingScreen.
|
private |
Reset the Game.
|
virtual |
|
private |
If the game has ended
|
private |
A int for the number of initial loops before the game should update
|
private |
The background music
|
private |
The loaded Object files
|
private |
A ParticleEffect for when the player passes the last ring
|
private |
The sound effect for missing the rings
|
private |
The sound effect for passing the rings
|
private |
The score of the Player. Lowest score is best. Score increases with time and decreases when a ring is gone through.
|
private |
|
private |
The time since the player reached the end