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 MotionSensor
Diff: Entity/Bosses/Skull/Skull.h
- Revision:
- 58:c8d90bb7404a
- Parent:
- 56:ef9521b7ed78
- Child:
- 59:fd4669864b67
- Child:
- 61:901871a7c6ff
--- a/Entity/Bosses/Skull/Skull.h Thu May 09 09:50:19 2019 +0000
+++ b/Entity/Bosses/Skull/Skull.h Thu May 09 14:43:45 2019 +0000
@@ -3,18 +3,49 @@
#include "Entity.h"
#define DASH_DELAY 120
+/**Skull Class
+@author Steven Mahasin
+@brief Creates a Skull which inherits the Entity class, this is currently the only boss in the game.
+@date May 2019
+*/
class Skull : public Entity {
private:
// Member Variables
+ /**
+ * @brief the shadow of Skull has a separate size and offset, so it has to have such member variable
+ */
SpriteSize _shadow;
+ /**
+ * @brief a status of wether the skull is dashing
+ */
bool _dash;
+ /**
+ * @brief a counter to let the skull dash periodically
+ */
int _dash_counter;
+ /**
+ * @brief an index to choose which velocity the Skull currently has when dashing
+ */
int _velocity_index;
// Member Functions
+ /**
+ * @brief increase _frame.count which increases _frame.number to animate skull
+ */
void increment_frames();
+ /**
+ * @brief updates the offset of the skull so that it floats up and down periodically above the shadow (purely graphical)
+ */
void update_offsets();
+ /**
+ * @brief moves the skull towards the player, similar to headless
+ * @param player_x @details player x-position
+ * @param player_y @details player y-position
+ */
void approaching_movement(float player_x, float player_y);
+ /**
+ * @brief moves the skull in a dashing manner
+ */
void dash_movement();
public:
@@ -22,8 +53,23 @@
Skull(float pos_x, float pos_y);
// Functions
- virtual void move(float, float, char * map, bool * doorways); // movement control and miscellaneous updates
+ /**
+ * @brief calls the function and conditions to move (both dashing and approaching)
+ * @param x_value @details player x-position
+ * @param y_value @details player y-position
+ * @param map @details the 2d map array that dictates where there are walls or empty space
+ * @param doorways @details an array that dictates which side of the wall has a doorway
+ */
+ virtual void move(float x_value, float y_value, char * map, bool * doorways); // movement control and miscellaneous updates
+ /**
+ * @brief reduce _hp by damage
+ * @param damage @details the amount of damage to be taken
+ */
virtual void take_damage(int);
+ /**
+ * @brief a function of drawing the skull onto the screen
+ * @param lcd @details the screen where the skull is drawn on
+ */
virtual void draw(N5110 &lcd);
};