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: Enemy/Enemy.h
- Revision:
- 29:15e9640646b7
- Parent:
- 26:d16a5b1e0ace
- Child:
- 37:71f2cd073739
--- a/Enemy/Enemy.h Wed May 08 18:02:11 2019 +0000 +++ b/Enemy/Enemy.h Wed May 08 21:11:35 2019 +0000 @@ -4,39 +4,25 @@ #include "mbed.h" #include "N5110.h" #include "Gamepad.h" -#include "Bullet.h" /** Enemy class -@brief Class for the ghost enemies +@brief Class for the ghost enemies @author Melissa Hartmann @date May 2019 */ -class Enemy{ +class Enemy +{ public: Enemy(); ~Enemy(); - /** - @brief Defines the initial position of the enemy - @param float position_x uses float since the velocity will be added, which is not an integer. - @param float position_y uses float since the velocity will be added, which is not an integer. - @param double velocity_y needs to be double in order for it to decelerate to a small value that - approaches zero. - @details The intial position of the doodler is at the centre of the screen and the values are - gotten from the Engine class. It also defines the gravity as a positive vale greater than 1 - and the up object as a negative vale less than 1. - */ - void init(float floor_pos_x, float floor_pos_y); + void update(Vector2D floor_pos); void draw(N5110 &lcd); - void update(float floor_pos_x, float floor_pos_y); - Vector2D get_position(); - void set_position(Vector2D pos); // mutators + void erase(); + Vector2D get_position(); void set_score(int score); - + private: - Bullet b; Vector2D _position; - float bullet_pos_y; - int _radius; }; #endif \ No newline at end of file