Nemesis game third enemy
Enemy3.h
- Committer:
- musallambseiso
- Date:
- 2017-05-03
- Revision:
- 4:bc02594c4902
- Parent:
- 3:ed7f3ee41871
File content as of revision 4:bc02594c4902:
#ifndef ENEMY3_H #define ENEMY3_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Friendly.h" /** Enemy3 Class @brief Used for generating the third enemy ship in the Nemesis game. Includes drawing and updating functions. @brief Incorporates N5110.h file by Craig A. Evans. @brief Revision 1.0 @author Musallam M. M. Bseiso @date 3rd May 2017 */ class Enemy3 { public: /// Constructor and destructor: Enemy3(); ~Enemy3(); //////////////////////////////// //////// PUBLIC METHODS //////////////////////////////// /** Initialize Enemy3 * * Initializes third enemy ship x (random) & y (fixed) positions, as well as speed. */ void init(int speed); /** Draw Enemy3 * * Draws the third enemy ship onto the LCD, in accordance with the parameters initialized in the "init" method. * @param N5110 - nokia LCD library * @param lcd - pointer to nokia LCD library */ void draw(N5110 &lcd); /** Update Enemy3 * * Updates the third enemy ship's x and y position. X and y positions are altered by adding speeds. */ void update(); /** Get Enemy3 Position * * Obtains the position (x and y coordinates) of the third 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