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
Enemy/Enemy.h@24:67dc71a8f009, 2019-05-08 (annotated)
- Committer:
- el17m2h
- Date:
- Wed May 08 14:24:53 2019 +0000
- Revision:
- 24:67dc71a8f009
- Parent:
- 22:0d2ac98a8b48
- Child:
- 26:d16a5b1e0ace
Added comments to the doodler h file.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el17m2h | 20:a359092079b0 | 1 | #ifndef ENEMY_H |
el17m2h | 20:a359092079b0 | 2 | #define ENEMY_H |
el17m2h | 20:a359092079b0 | 3 | |
el17m2h | 20:a359092079b0 | 4 | #include "mbed.h" |
el17m2h | 20:a359092079b0 | 5 | #include "N5110.h" |
el17m2h | 20:a359092079b0 | 6 | #include "Gamepad.h" |
el17m2h | 20:a359092079b0 | 7 | #include "Bullet.h" |
el17m2h | 20:a359092079b0 | 8 | |
el17m2h | 24:67dc71a8f009 | 9 | /** Enemy class |
el17m2h | 24:67dc71a8f009 | 10 | @brief Class for the ghost enemies |
el17m2h | 24:67dc71a8f009 | 11 | @author Melissa Hartmann |
el17m2h | 24:67dc71a8f009 | 12 | @date May 2019 |
el17m2h | 24:67dc71a8f009 | 13 | */ |
el17m2h | 24:67dc71a8f009 | 14 | |
el17m2h | 20:a359092079b0 | 15 | class Enemy{ |
el17m2h | 20:a359092079b0 | 16 | public: |
el17m2h | 20:a359092079b0 | 17 | Enemy(); |
el17m2h | 20:a359092079b0 | 18 | ~Enemy(); |
el17m2h | 20:a359092079b0 | 19 | void init(float floor_pos_x, float floor_pos_y); |
el17m2h | 20:a359092079b0 | 20 | void draw(N5110 &lcd); |
el17m2h | 20:a359092079b0 | 21 | void update(float floor_pos_x, float floor_pos_y); |
el17m2h | 20:a359092079b0 | 22 | Vector2D get_position(); |
el17m2h | 20:a359092079b0 | 23 | void set_position(Vector2D pos); // mutators |
el17m2h | 20:a359092079b0 | 24 | void set_score(int score); |
el17m2h | 20:a359092079b0 | 25 | |
el17m2h | 20:a359092079b0 | 26 | private: |
el17m2h | 22:0d2ac98a8b48 | 27 | Bullet b; |
el17m2h | 20:a359092079b0 | 28 | Vector2D _position; |
el17m2h | 20:a359092079b0 | 29 | float bullet_pos_y; |
el17m2h | 20:a359092079b0 | 30 | int _radius; |
el17m2h | 20:a359092079b0 | 31 | }; |
el17m2h | 20:a359092079b0 | 32 | #endif |