GEJM
1.0.0.0
a 2D platformer made by students
|
#include <Game.h>
Public Member Functions | |
Game () | |
~Game () | |
void | gameLoop () |
void | startGame () |
void | pauseGame () |
void | resumeGame () |
void | quitToMenu () |
void | gameOver () |
void | wonGame () |
void | loadLevel () |
void | unloadLevel () |
GameState | getGameState () const |
PlayerController * | getPlayerController () const |
bool | getHasEnded () const |
bool | getPosUpdated () const |
int | getLevelWidth () const |
int | getLevelHeight () const |
Uint8 | getLevelCoins () const |
double | getPosAlpha () const |
std::list< Object * > const & | getObjectList () const |
Game is a core game class. It's responsible for level loading and updating game state.
Game::Game | ( | ) |
The default constructor. Sets gameState to menu.
Game implementation The default constructor. Sets gameState to menu.
Game::~Game | ( | ) |
The default destructor. Unloads level.
void Game::gameLoop | ( | ) |
Updates current state of game.
void Game::gameOver | ( | ) |
Changes gameState to GameState::Quit.
GameState Game::getGameState | ( | ) | const |
Get current GameState.
bool Game::getHasEnded | ( | ) | const |
Check if game has ended.
Uint8 Game::getLevelCoins | ( | ) | const |
Get number of coins spawned on loaded level.
int Game::getLevelHeight | ( | ) | const |
Get height of loaded level.
int Game::getLevelWidth | ( | ) | const |
Get width of loaded level.
std::list< Object * > const & Game::getObjectList | ( | ) | const |
Get reference to constant list of loaded game objects.
PlayerController * Game::getPlayerController | ( | ) | const |
Get pointer to PlayerController.
double Game::getPosAlpha | ( | ) | const |
Get coefficient of game state between steps, where 0 is previous step and 1 is current step.
bool Game::getPosUpdated | ( | ) | const |
Check if game state has changed.
void Game::loadLevel | ( | ) |
void Game::pauseGame | ( | ) |
Changes gameState to GameState::Pause.
void Game::quitToMenu | ( | ) |
Changes gameState to GameState::Menu and unloads level.
void Game::resumeGame | ( | ) |
Changes gameState to GameState::Playing.
void Game::startGame | ( | ) |
Changes gameState to GameState::Playing and loads level.
void Game::unloadLevel | ( | ) |
Unloads level if loaded.
void Game::wonGame | ( | ) |
Changes gameState to GameState::Won.