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
Diff: Spikes/Spikes.h
- Revision:
- 20:6db651a3cfec
- Parent:
- 19:33c77517cb88
--- a/Spikes/Spikes.h Thu May 21 13:54:14 2020 +0000
+++ b/Spikes/Spikes.h Fri May 22 14:06:35 2020 +0000
@@ -7,34 +7,96 @@
#include "Aim.h"
#include "Heston.h"
-/** spikes Class
-@date april 2020
-*/
+/** Spikes class
+ * @brief falling sprites to be avoided
+ * @author Joe Body, University of Leeds
+ * @date May 2020
+ */
class Spikes
{
public:
+
+ /** Constructor */
Spikes();
+
+ /** Destructor */
~Spikes();
+
+ /** Initalises Spikes*/
void init();
+
+ /** Draws the first type of spike
+ * @param lcd @details N5110 object
+ */
void draw(N5110 &lcd);
+
+ /** Draws the second type of spike
+ * @param lcd @details N5110 object
+ */
void draw2(N5110 &lcd);
+
+ /** Draws the third type of spike
+ * @param lcd @details N5110 object
+ */
void draw3(N5110 &lcd);
+
+ /** update the y direction */
void updatey();
+
+ /** update the x direction */
void updatex();
+
+ /** update the x direction negatively*/
void updatexn();
+
+ /** set initial random position of a spike
+ * @param int x @ details 1-4 determines general section of screen
+ */
void position(int x);
+
+ /** set co ordinates of sprite
+ * @param int x
+ * @param int y
+ */
void set_pos(int x, int y);
+
+ /** gets co-ordinates of the sprite
+ * @ return position vector
+ */
Vector2D get_pos();
+
+ /** set co ordinates of sprite
+ * @param pad @detail Gampad object
+ */
void hit(Gamepad &pad);
private:
-
+
+ /**vertical size sprite
+ * @return _height
+ */
int _height;
+
+ /**horizontal size sprite
+ * @return _height
+ */
int _width;
+
+ /** x position of sprite
+ * @return _x
+ */
int _x;
+
+ /** y position of sprite
+ * @return _y
+ */
int _y;
+
+ /** speed of sprite
+ * @return _speed
+ */
int _speed;
};