ELEC2645 (2018/19) / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Committer:
RexRoshan
Date:
Thu May 09 09:49:35 2019 +0000
Revision:
0:d9cf94b41df3
Documentation has been completed and the code has been slightly modified

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RexRoshan 0:d9cf94b41df3 1 #ifndef ENEMY22_H
RexRoshan 0:d9cf94b41df3 2 #define ENEMY22_H
RexRoshan 0:d9cf94b41df3 3
RexRoshan 0:d9cf94b41df3 4 #include "mbed.h"
RexRoshan 0:d9cf94b41df3 5 #include "N5110.h"
RexRoshan 0:d9cf94b41df3 6 #include "Gamepad.h"
RexRoshan 0:d9cf94b41df3 7
RexRoshan 0:d9cf94b41df3 8
RexRoshan 0:d9cf94b41df3 9 /** Enemy22 Class
RexRoshan 0:d9cf94b41df3 10 * @brief Second enemy for stage two
RexRoshan 0:d9cf94b41df3 11 * @author Rex Roshan Raj
RexRoshan 0:d9cf94b41df3 12 */
RexRoshan 0:d9cf94b41df3 13 class Enemy22
RexRoshan 0:d9cf94b41df3 14 {
RexRoshan 0:d9cf94b41df3 15
RexRoshan 0:d9cf94b41df3 16 public:
RexRoshan 0:d9cf94b41df3 17
RexRoshan 0:d9cf94b41df3 18 /** Constructor */
RexRoshan 0:d9cf94b41df3 19 Enemy22();
RexRoshan 0:d9cf94b41df3 20
RexRoshan 0:d9cf94b41df3 21 /** Destructor */
RexRoshan 0:d9cf94b41df3 22 ~Enemy22();
RexRoshan 0:d9cf94b41df3 23
RexRoshan 0:d9cf94b41df3 24 /** Initialise the parameters for the second enemy in stage two
RexRoshan 0:d9cf94b41df3 25 *@param a - x position of the enemy
RexRoshan 0:d9cf94b41df3 26 *@param b - y position of the enemy
RexRoshan 0:d9cf94b41df3 27 *@param speed - the speed of the enemy moving
RexRoshan 0:d9cf94b41df3 28 */
RexRoshan 0:d9cf94b41df3 29 void init(int a,int b,int speed);
RexRoshan 0:d9cf94b41df3 30
RexRoshan 0:d9cf94b41df3 31 /** Draws enemy
RexRoshan 0:d9cf94b41df3 32 * @param N5110 lcd
RexRoshan 0:d9cf94b41df3 33 * @brief Draws the second enemy in stage two
RexRoshan 0:d9cf94b41df3 34 */
RexRoshan 0:d9cf94b41df3 35 void enemy2(N5110 &lcd);
RexRoshan 0:d9cf94b41df3 36
RexRoshan 0:d9cf94b41df3 37 /** Updates the movement
RexRoshan 0:d9cf94b41df3 38 * @brief Changes the movement of the enemy
RexRoshan 0:d9cf94b41df3 39 */
RexRoshan 0:d9cf94b41df3 40 void update();
RexRoshan 0:d9cf94b41df3 41
RexRoshan 0:d9cf94b41df3 42 /** Adds the value of health by 1 */
RexRoshan 0:d9cf94b41df3 43 void add_health();
RexRoshan 0:d9cf94b41df3 44
RexRoshan 0:d9cf94b41df3 45 /** Sets the movement of the enemy
RexRoshan 0:d9cf94b41df3 46 * @param movement
RexRoshan 0:d9cf94b41df3 47 */
RexRoshan 0:d9cf94b41df3 48 void set_movement(Vector2D m);
RexRoshan 0:d9cf94b41df3 49
RexRoshan 0:d9cf94b41df3 50 /** Sets the position of the enemy
RexRoshan 0:d9cf94b41df3 51 * @param position of the enemy
RexRoshan 0:d9cf94b41df3 52 */
RexRoshan 0:d9cf94b41df3 53 void set_enemy22_pos(Vector2D e);
RexRoshan 0:d9cf94b41df3 54
RexRoshan 0:d9cf94b41df3 55 /** Gets the value of the health
RexRoshan 0:d9cf94b41df3 56 * @returns value in range 0 to 10
RexRoshan 0:d9cf94b41df3 57 */
RexRoshan 0:d9cf94b41df3 58 int get_health();
RexRoshan 0:d9cf94b41df3 59
RexRoshan 0:d9cf94b41df3 60 /** Gets the position of the enemy
RexRoshan 0:d9cf94b41df3 61 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 62 */
RexRoshan 0:d9cf94b41df3 63 Vector2D get_enemy22_pos();
RexRoshan 0:d9cf94b41df3 64
RexRoshan 0:d9cf94b41df3 65 /** Gets the movement of the enemy
RexRoshan 0:d9cf94b41df3 66 * @returns a struct with x,y members which corresponds to x and y movement respectively
RexRoshan 0:d9cf94b41df3 67 */
RexRoshan 0:d9cf94b41df3 68 Vector2D get_movement();
RexRoshan 0:d9cf94b41df3 69
RexRoshan 0:d9cf94b41df3 70 private:
RexRoshan 0:d9cf94b41df3 71
RexRoshan 0:d9cf94b41df3 72 Vector2D _movement;
RexRoshan 0:d9cf94b41df3 73 int _a;
RexRoshan 0:d9cf94b41df3 74 int _b;
RexRoshan 0:d9cf94b41df3 75 int _c;
RexRoshan 0:d9cf94b41df3 76 int _speed;
RexRoshan 0:d9cf94b41df3 77 int _health;
RexRoshan 0:d9cf94b41df3 78
RexRoshan 0:d9cf94b41df3 79 };
RexRoshan 0:d9cf94b41df3 80
RexRoshan 0:d9cf94b41df3 81 #endif