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.h
00001 #ifndef EXPLOSION_H 00002 #define EXPLOSION_H 00003 00004 // Included Headers ------------------------------------------------------------ 00005 #include "mbed.h" 00006 #include "N5110.h" 00007 #include "Position.h" 00008 00009 /** Animation Struct 00010 * @brief Struct to draw explosion animation 00011 */ 00012 struct Animation{ 00013 bool draw_circle_one; /**< Bool to draw circle one */ 00014 bool draw_circle_two; /**< Bool to draw circle two */ 00015 FillType circle_one; /**< Fill type of circle one */ 00016 FillType circle_two; /**< Fill type of circle two */ 00017 }; 00018 00019 /** Explosion class 00020 * @brief Draws explosion animation 00021 * @author Benjamin Evans, University of Leeds 00022 * @date May 2020 00023 */ 00024 class Explosion: public Position { 00025 public: 00026 /** Constructor */ 00027 Explosion(); 00028 00029 /** Destructor */ 00030 ~Explosion(); 00031 00032 /** Initialises explosion 00033 * @param destroyed_position @details Vector2D of destroyed xy pos 00034 */ 00035 void init(Vector2D destroyed_position); 00036 00037 /** Draws the explosion 00038 * @param lcd @details N5110 object 00039 */ 00040 void draw_explosion(N5110 &lcd); 00041 00042 // Accessors and mutators -------------------------------------------------- 00043 00044 /** Gets the explosion radius 00045 * @returns explosion_radius_ 00046 */ 00047 int get_explosion_radius(); 00048 00049 private: 00050 00051 // Variables --------------------------------------------------------------- 00052 00053 /** Explosion circle radius */ 00054 int explosion_radius_; 00055 00056 /** FSM counter for state in FSM */ 00057 int fsm_counter_; 00058 00059 /** Draw cunter */ 00060 int draw_counter; 00061 }; 00062 00063 #endif
Generated on Fri Aug 5 2022 06:55:07 by
1.7.2