Nemesis game, fifth enemy
Diff: Enemy5.h
- Revision:
- 3:6b0386fe794c
- Child:
- 4:4932cfd474c9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Enemy5.h Tue May 02 22:14:38 2017 +0000 @@ -0,0 +1,68 @@ +#ifndef ENEMY5_H +#define ENEMY5_H + +#include "mbed.h" +#include "N5110.h" +#include "Gamepad.h" +#include "Friendly.h" + +class Enemy5 +{ + +public: + + /// Constructor and destructor: + Enemy5(); + ~Enemy5(); + + + //////////////////////////////// + //////// PUBLIC METHODS + //////////////////////////////// + + + /** Initialize Enemy5 + * + * Initializes fifth enemy ship x (random) & y (fixed) positions, as well as speed. + */ + void init(int speed); + + + /** Draw Enemy5 + * + * Draws the fifth enemy ship onto the LCD, in accordance with the parameters initialized in the "init" method. + */ + void draw(N5110 &lcd); + + + /** Update Enemy5 + * + * Updates the fifth enemy ship's x and y position. X and y positions are altered by adding speeds. + */ + void update(); + + + /** Get Enemy5 Position + * + * Obtains the position (x and y coordinates) of the fifth enemy ship at any given time, into a two-dimensional vector. + * @returns p - the Vector2D of the parameters + */ + Vector2D get_pos(); + +private: + + + //////////////////////////////// + //////// PRIVATE VARIABLES + //////////////////////////////// + + + /// Vector2D that stores two speeds, one for x and one for y. + Vector2D _velocity; + + /// Integer variables to store the x and y coordinates of the friendly ship: + int _x; + int _y; + +}; +#endif \ No newline at end of file