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.
Diff: Enemy/Enemy.h
- Revision:
- 21:3235ac9b6e7b
- Parent:
- 15:3dbb3f4d7ae6
- Child:
- 22:f329b05e26ff
diff -r f74d0bc4720c -r 3235ac9b6e7b Enemy/Enemy.h
--- a/Enemy/Enemy.h Tue May 26 23:22:22 2020 +0000
+++ b/Enemy/Enemy.h Tue May 26 23:34:57 2020 +0000
@@ -2,18 +2,37 @@
#include "N5110.h"
#include "Gamepad.h"
+/** Enemy Class
+@brief - Defines instances of Enemies for a 2D shooter game
+
+@author Albert Tan Muligan, Student at University of Leeds
+@date May 2020
+
+
+*/
class Enemy
{
public:
+ /**
+ * @brief Constructor that sets inital x and y with random seet
+ * @param x and y @details x and y in pixels (places enemy somewhere on the edge of a 84x48 board)
+ */
Enemy(int seed);
~Enemy();
void draw(N5110 &lcd);
void update(int player_x, int player_y);
+ ///X value accessor
int get_x();
+ ///Y value accessor
int get_y();
+ /**
+ * @brief Reset enemy to edge with random seed, and creates an animation on death
+ * @param seed, lcd @details integer seed and pointer to lcd
+ */
void reset(int seed, N5110 &lcd);
private:
+ ///small animation on death
void death_animation(N5110 &lcd);
int _x;
int _y;