SDL Breakout Engine  0.1.0
An implementation of a Breakout game using sdl, implemented with efficient resource management.
Public Member Functions | Static Public Member Functions | List of all members
GameManager Class Reference

#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 ()
 

Detailed Description

Simple game manager to handle breakout game logic.

Constructor & Destructor Documentation

GameManager::GameManager ( const GameManager &  )
delete

GameManager is a singleton.

Member Function Documentation

bool GameManager::ButtonState ( const Button b) const

Query a button's state.

Parameters
bthe 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.

GameManager & GameManager::instance ( )
static

returns a singleton instance of GameManager

void GameManager::LoseLife ( )

Lose a life if the ball falls to the bottom of the screen.

void GameManager::operator= ( GameManager const &  )
delete

GameManager is a singleton.

void GameManager::PressButton ( const Button b)

press a button down (set it to on).

Parameters
bthe button
void GameManager::ReleaseButton ( const Button b)

release a button (set it to off).

Parameters
bthe 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.

Parameters
numBrickshow many bricks are in this game.
void GameManager::ToggleButton ( const Button b)

Toggle a button's state

Parameters
bthe button

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