ELEC2645 (2017/18) / Mbed OS el16ajm
Embed: (wiki syntax)

« Back to documentation index

Engine Class Reference

Engine Class Reference

The Game Engine class. More...

#include <Engine.h>

Public Member Functions

 Engine ()
 Constructor.
 ~Engine ()
 Destructor.
void init ()
 Initialisation function.
void read_input (Gamepad &pad)
 Reads and stores the current inputs from the gamepad.
void update (Gamepad &pad)
 Updates the current game state.
void draw (N5110 &lcd)
 Draws the current state of the game.
void gameOverScreen (N5110 &lcd)
 Applies a splash screen to signify a game over state has been reached.
float getScore ()
 Gets the current score.
bool getGameOver ()
 Gets the current game state.
void setLvl (int _levelToSet)
 Sets the current level.

Detailed Description

The Game Engine class.

Handles all failure states and game drawing

Author:
Andrew J. Moore
Date:
May, 2018

Definition at line 13 of file Engine.h.


Constructor & Destructor Documentation

Engine (  )

Constructor.

Definition at line 3 of file Engine.cpp.

~Engine (  )

Destructor.

Definition at line 8 of file Engine.cpp.


Member Function Documentation

void draw ( N5110 lcd )

Draws the current state of the game.

Parameters:
theLCD so that it can be drawn to (N5110)

Definition at line 123 of file Engine.cpp.

void gameOverScreen ( N5110 lcd )

Applies a splash screen to signify a game over state has been reached.

Parameters:
theLCD so that it can be drawn to (N5110)

Definition at line 145 of file Engine.cpp.

bool getGameOver (  )

Gets the current game state.

Returns:
the value of _gameOver

Definition at line 237 of file Engine.cpp.

float getScore (  )

Gets the current score.

Returns:
the current score

Definition at line 231 of file Engine.cpp.

void init (  )

Initialisation function.

Definition at line 13 of file Engine.cpp.

void read_input ( Gamepad pad )

Reads and stores the current inputs from the gamepad.

Parameters:
thecurrent state of the gamepad (Gamepad)

Definition at line 118 of file Engine.cpp.

void setLvl ( int  _levelToSet )

Sets the current level.

Parameters:
thelevel to be set to (int)

Definition at line 24 of file Engine.cpp.

void update ( Gamepad pad )

Updates the current game state.

Parameters:
thegamepad's functions as it is needed to use the speaker (Gamepad)

Definition at line 157 of file Engine.cpp.