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@29:15e9640646b7, 2019-05-08 (annotated)
- Committer:
- el17m2h
- Date:
- Wed May 08 21:11:35 2019 +0000
- Revision:
- 29:15e9640646b7
- Parent:
- 26:d16a5b1e0ace
- Child:
- 37:71f2cd073739
Changed the enemy file so that it has functions to make it update its position or make it disappear from the screen. The floors h file includes the enemy, and depending on its position it updates it or not.
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 | |
el17m2h | 24:67dc71a8f009 | 8 | /** Enemy class |
el17m2h | 29:15e9640646b7 | 9 | @brief Class for the ghost enemies |
el17m2h | 24:67dc71a8f009 | 10 | @author Melissa Hartmann |
el17m2h | 24:67dc71a8f009 | 11 | @date May 2019 |
el17m2h | 24:67dc71a8f009 | 12 | */ |
el17m2h | 24:67dc71a8f009 | 13 | |
el17m2h | 29:15e9640646b7 | 14 | class Enemy |
el17m2h | 29:15e9640646b7 | 15 | { |
el17m2h | 20:a359092079b0 | 16 | public: |
el17m2h | 20:a359092079b0 | 17 | Enemy(); |
el17m2h | 20:a359092079b0 | 18 | ~Enemy(); |
el17m2h | 29:15e9640646b7 | 19 | void update(Vector2D floor_pos); |
el17m2h | 20:a359092079b0 | 20 | void draw(N5110 &lcd); |
el17m2h | 29:15e9640646b7 | 21 | void erase(); |
el17m2h | 29:15e9640646b7 | 22 | Vector2D get_position(); |
el17m2h | 20:a359092079b0 | 23 | void set_score(int score); |
el17m2h | 29:15e9640646b7 | 24 | |
el17m2h | 20:a359092079b0 | 25 | private: |
el17m2h | 20:a359092079b0 | 26 | Vector2D _position; |
el17m2h | 20:a359092079b0 | 27 | }; |
el17m2h | 20:a359092079b0 | 28 | #endif |