|
SDL Breakout Engine
0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
|
#include <GameManager.hpp>
Public Member Functions | |
| int | startUp (const int &numBricks) |
| GameState | GameOver () const |
| int | GetScore () const |
| int | GetLives () const |
| void | ScorePoint () |
| void | LoseLife () |
| void | PressButton (const Button &b) |
| void | ReleaseButton (const Button &b) |
| void | ToggleButton (const Button &b) |
| bool | ButtonState (const Button &b) const |
| GameManager (const GameManager &) = delete | |
| GameManager is a singleton. More... | |
| void | operator= (GameManager const &) = delete |
| GameManager is a singleton. More... | |
Static Public Member Functions | |
| static GameManager & | instance () |
Simple game manager to handle breakout game logic.
|
delete |
GameManager is a singleton.
| bool GameManager::ButtonState | ( | const Button & | b | ) | const |
Query a button's state.
| b | the button |
| GameState GameManager::GameOver | ( | ) | const |
Is the game over.
| int GameManager::GetLives | ( | ) | const |
The player's lives.
| int GameManager::GetScore | ( | ) | const |
The player's score.
|
static |
returns a singleton instance of GameManager
| void GameManager::LoseLife | ( | ) |
Lose a life if the ball falls to the bottom of the screen.
|
delete |
GameManager is a singleton.
| void GameManager::PressButton | ( | const Button & | b | ) |
press a button down (set it to on).
| b | the button |
| void GameManager::ReleaseButton | ( | const Button & | b | ) |
release a button (set it to off).
| b | the button |
| void GameManager::ScorePoint | ( | ) |
Score a point if a brick breaks.
| int GameManager::startUp | ( | const int & | numBricks | ) |
starts up a level with a given number of bricks.
| numBricks | how many bricks are in this game. |
| void GameManager::ToggleButton | ( | const Button & | b | ) |
Toggle a button's state
| b | the button |
1.4.1