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.
Dependencies: mbed
Diff: Engine/Engine.h
- Revision:
- 27:af14fcd5a520
- Parent:
- 26:d16a5b1e0ace
- Child:
- 28:e0161a52a8b9
--- a/Engine/Engine.h Wed May 08 17:24:35 2019 +0000
+++ b/Engine/Engine.h Wed May 08 17:51:07 2019 +0000
@@ -54,11 +54,12 @@
/**
@brief Updates the classes in the game by calling it's update functions
@param Gamepad &pad
- @details The function checks the collision of the doodler with the floors by getting their current positions
- and inputing them to the "check_floors_collision" function, which will update the velocity of the doodler. Next,
- it calls the "update" functions for the floors and doodler which will update their positions. It then calls the
- "add_score" function to update the score value. Finally, it checks if the doodler fire's by inputing the doodler's
- previous position and updated position, as well as the pad's input.
+ @details Firstly, the function checks the collision of the doodler with the floors by getting their current positions
+ and inputing them to the "check_floors_collision" function, which will update the velocity of the doodler. Secondly, it
+ calls the "update" functions for the floors and doodler which will update their positions. It then calls the
+ "add_score" function to update the score value. Next, it checks if the doodler fire's by inputing the doodler's
+ previous position and updated position, as well as the pad's input. Finally, it calls a function to check if the doodler
+ has reached the bottom of the screen to end the game.
*/
void update(Gamepad &pad);
@@ -105,12 +106,18 @@
*/
void add_score();
+ void set_game_over(float doodler_pos_y);
+
+
+ bool get_game_over();
+
private:
Bullet _b;
float _b_pos_x;
float _b_pos_y;
int _score;
+ bool game_ends;
Floors _f[6]; // array of 6 floors