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.
Explosion/Explosion.h@85:87bc28b151d8, 2020-05-26 (annotated)
- Committer:
- evanso
- Date:
- Tue May 26 19:38:48 2020 +0000
- Revision:
- 85:87bc28b151d8
- Parent:
- 83:35d1e846eab2
- Child:
- 86:eecd168c3a23
Spell checked all of code and comments
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| evanso | 25:70b55f5bfc87 | 1 | #ifndef EXPLOSION_H |
| evanso | 25:70b55f5bfc87 | 2 | #define EXPLOSION_H |
| evanso | 25:70b55f5bfc87 | 3 | |
| evanso | 82:3211b31e9421 | 4 | // Included Headers ------------------------------------------------------------ |
| evanso | 25:70b55f5bfc87 | 5 | #include "mbed.h" |
| evanso | 25:70b55f5bfc87 | 6 | #include "N5110.h" |
| evanso | 25:70b55f5bfc87 | 7 | #include "Gamepad.h" |
| evanso | 27:8bb2bd97c319 | 8 | #include "Position.h" |
| evanso | 25:70b55f5bfc87 | 9 | |
| evanso | 27:8bb2bd97c319 | 10 | /** Animation Struct |
| evanso | 27:8bb2bd97c319 | 11 | * @brief Struct to draw explosion animation |
| evanso | 27:8bb2bd97c319 | 12 | */ |
| evanso | 27:8bb2bd97c319 | 13 | struct Animation{ |
| evanso | 27:8bb2bd97c319 | 14 | bool draw_circle_one; /**< Bool to draw circle one */ |
| evanso | 27:8bb2bd97c319 | 15 | bool draw_circle_two; /**< Bool to draw circle two */ |
| evanso | 27:8bb2bd97c319 | 16 | FillType circle_one; /**< Fill type of circle one */ |
| evanso | 27:8bb2bd97c319 | 17 | FillType circle_two; /**< Fill type of circle two */ |
| evanso | 27:8bb2bd97c319 | 18 | }; |
| evanso | 27:8bb2bd97c319 | 19 | |
| evanso | 25:70b55f5bfc87 | 20 | /** Explosion class |
| evanso | 27:8bb2bd97c319 | 21 | * @brief Draws explosion animation |
| evanso | 27:8bb2bd97c319 | 22 | * @author Benjamin Evans, University of Leeds |
| evanso | 27:8bb2bd97c319 | 23 | * @date May 2020 |
| evanso | 27:8bb2bd97c319 | 24 | */ |
| evanso | 83:35d1e846eab2 | 25 | class Explosion: public Position { |
| evanso | 25:70b55f5bfc87 | 26 | public: |
| evanso | 25:70b55f5bfc87 | 27 | /** Constructor */ |
| evanso | 25:70b55f5bfc87 | 28 | Explosion(); |
| evanso | 25:70b55f5bfc87 | 29 | |
| evanso | 25:70b55f5bfc87 | 30 | /** Destructor */ |
| evanso | 25:70b55f5bfc87 | 31 | ~Explosion(); |
| evanso | 25:70b55f5bfc87 | 32 | |
| evanso | 85:87bc28b151d8 | 33 | /** Initialises explosion |
| evanso | 85:87bc28b151d8 | 34 | * @param destroyed_position @details Vector2D of destroyed xy pos |
| evanso | 29:e96d91f1d39c | 35 | */ |
| evanso | 29:e96d91f1d39c | 36 | void init(Vector2D destroyed_position); |
| evanso | 25:70b55f5bfc87 | 37 | |
| evanso | 25:70b55f5bfc87 | 38 | /** Draws the explosion |
| evanso | 27:8bb2bd97c319 | 39 | * @param lcd @details N5110 object |
| evanso | 25:70b55f5bfc87 | 40 | */ |
| evanso | 25:70b55f5bfc87 | 41 | void draw_explosion(N5110 &lcd); |
| evanso | 25:70b55f5bfc87 | 42 | |
| evanso | 25:70b55f5bfc87 | 43 | // Accessors and mutators -------------------------------------------------- |
| evanso | 25:70b55f5bfc87 | 44 | |
| evanso | 25:70b55f5bfc87 | 45 | /** Gets the explosion radius |
| evanso | 25:70b55f5bfc87 | 46 | * @returns explosion_radius_ |
| evanso | 25:70b55f5bfc87 | 47 | */ |
| evanso | 25:70b55f5bfc87 | 48 | int get_explosion_radius(); |
| evanso | 25:70b55f5bfc87 | 49 | |
| evanso | 25:70b55f5bfc87 | 50 | private: |
| evanso | 25:70b55f5bfc87 | 51 | |
| evanso | 85:87bc28b151d8 | 52 | // Variables --------------------------------------------------------------- |
| evanso | 25:70b55f5bfc87 | 53 | |
| evanso | 27:8bb2bd97c319 | 54 | /** Explosion circle radius */ |
| evanso | 25:70b55f5bfc87 | 55 | int explosion_radius_; |
| evanso | 25:70b55f5bfc87 | 56 | |
| evanso | 27:8bb2bd97c319 | 57 | /** FSM counter for state in FSM */ |
| evanso | 25:70b55f5bfc87 | 58 | int fsm_counter_; |
| evanso | 25:70b55f5bfc87 | 59 | |
| evanso | 27:8bb2bd97c319 | 60 | /** Draw cunter */ |
| evanso | 25:70b55f5bfc87 | 61 | int draw_counter; |
| evanso | 25:70b55f5bfc87 | 62 | }; |
| evanso | 25:70b55f5bfc87 | 63 | |
| evanso | 85:87bc28b151d8 | 64 | #endif |