Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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
- 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:
-
the LCD 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:
-
the LCD 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 | ( | ) |
| 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:
-
the current state of the gamepad (Gamepad)
Definition at line 118 of file Engine.cpp.
| void setLvl | ( | int | _levelToSet ) |
Sets the current level.
- Parameters:
-
the level to be set to (int)
Definition at line 24 of file Engine.cpp.
| void update | ( | Gamepad & | pad ) |
Updates the current game state.
- Parameters:
-
the gamepad's functions as it is needed to use the speaker (Gamepad)
Definition at line 157 of file Engine.cpp.
Generated on Sun Jul 17 2022 04:24:16 by
1.7.2