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:
- 24:67dc71a8f009
- Parent:
- 23:9be87557b89a
- Child:
- 26:d16a5b1e0ace
diff -r 9be87557b89a -r 67dc71a8f009 Engine/Engine.h
--- a/Engine/Engine.h Wed May 08 08:46:11 2019 +0000
+++ b/Engine/Engine.h Wed May 08 14:24:53 2019 +0000
@@ -9,18 +9,86 @@
#include "Doodler.h"
#include "Bullet.h"
+/** Engine class
+@brief Class for the engine of the game
+@author Melissa Hartmann
+@date May 2019
+*/
class Engine{
public:
Engine();
~Engine();
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void init(int floors_width, int floors_height);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void screen_init();
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void read_input(Gamepad &pad);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void update(Gamepad &pad);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void draw(N5110 &lcd);
- void check_floors_collision(float doodler_pos_x, float doodler_pos_y);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
+ void check_floors_collision(float doodler_pos_x, float doodler_pos_y, double doodler_vel_y);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void check_fire(Gamepad &pad, float updated_doodler_pos_x, float updated_doodler_pos_y, float doodler_pos_y);
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void add_score();
+
+ /**
+ @brief defines the initial position of the bullet
+ @param float dood_pos_x
+ @param float dood_pos_y
+ @details The intial position is in same position as doodler's trunk end (which is why I am adding the 12 and 4 to the doodler's position)
+ */
void print_score(N5110 &lcd);
private:
@@ -39,12 +107,12 @@
Vector2D _f_pos[6]; //
Doodler _dood;
- float _doodler_pos_x;
- float _doodler_pos_y;
- float _updated_doodler_pos_x;
- float _updated_doodler_pos_y;
- float _doodler_vel_x;
- double _doodler_vel_y;
+ float doodler_pos_x;
+ float doodler_pos_y;
+ float updated_doodler_pos_x;
+ float updated_doodler_pos_y;
+ float doodler_vel_x;
+ double doodler_vel_y;
float distance_y[6];
int _screen_pos_x;