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/Mobs/Headless/Headless.h
- Revision:
- 58:c8d90bb7404a
- Parent:
- 56:ef9521b7ed78
- Child:
- 59:fd4669864b67
diff -r 1c12361b6e3d -r c8d90bb7404a Entity/Mobs/Headless/Headless.h
--- a/Entity/Mobs/Headless/Headless.h Thu May 09 09:50:19 2019 +0000
+++ b/Entity/Mobs/Headless/Headless.h Thu May 09 14:43:45 2019 +0000
@@ -2,21 +2,52 @@
#define HEADLESS_H
#include "Entity.h"
+/**Headless Class
+@author Steven Mahasin
+@brief Creates a Headless which inherits the Entity class, this is one of the mobs that spawns in the normal rooms.
+@date May 2019
+*/
class Headless : public Entity
{
public:
- // Constructor
- Headless(float, float);
+ /** Constructor
+ * @brief creates a headless at positions pos_x and pos_y
+ * @param pos_x @details initialise _position.x
+ * @param pos_y @details initialise _position.y
+ */
+ Headless(float pos_x, float pos_y);
// Functions
+ /**
+ * @brief function moves the headless towards the player
+ * @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 player_x, float player_y, char * map, bool * doorways);
+ /**
+ * @brief reduce _hp by damage
+ * @param damage @details the amount of damage to be taken
+ */
+ virtual void take_damage(int damage);
+ /**
+ * @brief a virtual function of drawing the headless onto the screen
+ * @param lcd @details the screen where the headless is drawn on
+ */
virtual void draw(N5110 &lcd);
- virtual void take_damage(int damage);
private:
// Methods
+ /**
+ * @brief gets the sprite array
+ * @return char pointer array of the corresponding snake sprite frame
+ */
char * get_frame();
+ /**
+ * @brief increase _frame.count which increases _frame.number to animate snake
+ */
void increment_frame();
};