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.
Game Class Reference
#include <game.h>
Public Member Functions | |
Game () | |
Constructor. | |
bool | updateAndDraw () |
The main game function where all the gameplay and rendering happens. | |
void | startNewGame () |
Resets all the in game variable when new game begins. | |
bool | forceShildActivate () |
Check whether the button R was pressed or not to turn ON/OFF the shield. |
Detailed Description
Game Class.
Stores general game logic.
- Date:
- 15/04/2019
Definition at line 26 of file game.h.
Constructor & Destructor Documentation
Game | ( | ) |
Member Function Documentation
bool forceShildActivate | ( | ) |
Check whether the button R was pressed or not to turn ON/OFF the shield.
When the button R is pressed it sets bool "is_shield_active" to its opposite value. If the shield is active then, a ship with force shield sprite is drawn and the player's ability to shoot deactivates.
void startNewGame | ( | ) |
Resets all the in game variable when new game begins.
This function resets all the values to their intial states when the game is first began when the player dies and wants to restart the game.
This function resets all the values to their intial states when the game is first began when the player dies and wants to restart the game. It does not reset the values when the game is paused.
It does not reset the values when the game is paused.
bool updateAndDraw | ( | ) |
The main game function where all the gameplay and rendering happens.
This is the main function of game.cpp, where the actual gameplay happens.
This is the main function of game.cpp, where the actual gameplay happens. Here all other functions are activeated, and when the player dies, it returns back to main menu "main.cpp" it also draws all sprites in the game.
- Returns:
- bool want_to_pause, when "START" button is pressed.
Here all other functions are activeated, and when the player dies, it returns back to main menu "main.cpp".
Generated on Wed Dec 20 2023 20:30:17 by
