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@86:eecd168c3a23, 2020-05-27 (annotated)
- Committer:
- evanso
- Date:
- Wed May 27 00:32:04 2020 +0000
- Revision:
- 86:eecd168c3a23
- Parent:
- 85:87bc28b151d8
Fixed bugs in play game and removed any excess included headers.
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 | 27:8bb2bd97c319 | 7 | #include "Position.h" |
| evanso | 25:70b55f5bfc87 | 8 | |
| evanso | 27:8bb2bd97c319 | 9 | /** Animation Struct |
| evanso | 27:8bb2bd97c319 | 10 | * @brief Struct to draw explosion animation |
| evanso | 27:8bb2bd97c319 | 11 | */ |
| evanso | 27:8bb2bd97c319 | 12 | struct Animation{ |
| evanso | 27:8bb2bd97c319 | 13 | bool draw_circle_one; /**< Bool to draw circle one */ |
| evanso | 27:8bb2bd97c319 | 14 | bool draw_circle_two; /**< Bool to draw circle two */ |
| evanso | 27:8bb2bd97c319 | 15 | FillType circle_one; /**< Fill type of circle one */ |
| evanso | 27:8bb2bd97c319 | 16 | FillType circle_two; /**< Fill type of circle two */ |
| evanso | 27:8bb2bd97c319 | 17 | }; |
| evanso | 27:8bb2bd97c319 | 18 | |
| evanso | 25:70b55f5bfc87 | 19 | /** Explosion class |
| evanso | 27:8bb2bd97c319 | 20 | * @brief Draws explosion animation |
| evanso | 27:8bb2bd97c319 | 21 | * @author Benjamin Evans, University of Leeds |
| evanso | 27:8bb2bd97c319 | 22 | * @date May 2020 |
| evanso | 27:8bb2bd97c319 | 23 | */ |
| evanso | 83:35d1e846eab2 | 24 | class Explosion: public Position { |
| evanso | 25:70b55f5bfc87 | 25 | public: |
| evanso | 25:70b55f5bfc87 | 26 | /** Constructor */ |
| evanso | 25:70b55f5bfc87 | 27 | Explosion(); |
| evanso | 25:70b55f5bfc87 | 28 | |
| evanso | 25:70b55f5bfc87 | 29 | /** Destructor */ |
| evanso | 25:70b55f5bfc87 | 30 | ~Explosion(); |
| evanso | 25:70b55f5bfc87 | 31 | |
| evanso | 85:87bc28b151d8 | 32 | /** Initialises explosion |
| evanso | 85:87bc28b151d8 | 33 | * @param destroyed_position @details Vector2D of destroyed xy pos |
| evanso | 29:e96d91f1d39c | 34 | */ |
| evanso | 29:e96d91f1d39c | 35 | void init(Vector2D destroyed_position); |
| evanso | 25:70b55f5bfc87 | 36 | |
| evanso | 25:70b55f5bfc87 | 37 | /** Draws the explosion |
| evanso | 27:8bb2bd97c319 | 38 | * @param lcd @details N5110 object |
| evanso | 25:70b55f5bfc87 | 39 | */ |
| evanso | 25:70b55f5bfc87 | 40 | void draw_explosion(N5110 &lcd); |
| evanso | 25:70b55f5bfc87 | 41 | |
| evanso | 25:70b55f5bfc87 | 42 | // Accessors and mutators -------------------------------------------------- |
| evanso | 25:70b55f5bfc87 | 43 | |
| evanso | 25:70b55f5bfc87 | 44 | /** Gets the explosion radius |
| evanso | 25:70b55f5bfc87 | 45 | * @returns explosion_radius_ |
| evanso | 25:70b55f5bfc87 | 46 | */ |
| evanso | 25:70b55f5bfc87 | 47 | int get_explosion_radius(); |
| evanso | 25:70b55f5bfc87 | 48 | |
| evanso | 25:70b55f5bfc87 | 49 | private: |
| evanso | 25:70b55f5bfc87 | 50 | |
| evanso | 85:87bc28b151d8 | 51 | // Variables --------------------------------------------------------------- |
| evanso | 25:70b55f5bfc87 | 52 | |
| evanso | 27:8bb2bd97c319 | 53 | /** Explosion circle radius */ |
| evanso | 25:70b55f5bfc87 | 54 | int explosion_radius_; |
| evanso | 25:70b55f5bfc87 | 55 | |
| evanso | 27:8bb2bd97c319 | 56 | /** FSM counter for state in FSM */ |
| evanso | 25:70b55f5bfc87 | 57 | int fsm_counter_; |
| evanso | 25:70b55f5bfc87 | 58 | |
| evanso | 27:8bb2bd97c319 | 59 | /** Draw cunter */ |
| evanso | 25:70b55f5bfc87 | 60 | int draw_counter; |
| evanso | 25:70b55f5bfc87 | 61 | }; |
| evanso | 25:70b55f5bfc87 | 62 | |
| evanso | 85:87bc28b151d8 | 63 | #endif |