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 ENEMYBOSS_H
RexRoshan 0:d9cf94b41df3 2 #define ENEMYBOSS_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 #include "Enemy.h"
RexRoshan 0:d9cf94b41df3 8
RexRoshan 0:d9cf94b41df3 9 /** EnemyBoss Class
RexRoshan 0:d9cf94b41df3 10 * @brief Enemies for stage three
RexRoshan 0:d9cf94b41df3 11 * @author Rex Roshan Raj
RexRoshan 0:d9cf94b41df3 12 */
RexRoshan 0:d9cf94b41df3 13 class EnemyBoss
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 EnemyBoss();
RexRoshan 0:d9cf94b41df3 20
RexRoshan 0:d9cf94b41df3 21 /** Destructor */
RexRoshan 0:d9cf94b41df3 22 ~EnemyBoss();
RexRoshan 0:d9cf94b41df3 23
RexRoshan 0:d9cf94b41df3 24 /** Initialise the parameters for the enemies in stage three
RexRoshan 0:d9cf94b41df3 25 *@param a - x position of the boss
RexRoshan 0:d9cf94b41df3 26 *@param b - y position of the boss
RexRoshan 0:d9cf94b41df3 27 *@param c - x position of the first enemy
RexRoshan 0:d9cf94b41df3 28 *@param d - y position of the first enemy
RexRoshan 0:d9cf94b41df3 29 *@param e - x position of the second enemy
RexRoshan 0:d9cf94b41df3 30 *@param f - y position of the second enemy
RexRoshan 0:d9cf94b41df3 31 *@param speed - the speed of the boss moving
RexRoshan 0:d9cf94b41df3 32 */
RexRoshan 0:d9cf94b41df3 33 void init(int a,int b,int c,int d,int e,int f, int speed);
RexRoshan 0:d9cf94b41df3 34
RexRoshan 0:d9cf94b41df3 35 /** Draws enemy
RexRoshan 0:d9cf94b41df3 36 * @param N5110 lcd
RexRoshan 0:d9cf94b41df3 37 * @brief Draws all three enemies in stage three
RexRoshan 0:d9cf94b41df3 38 */
RexRoshan 0:d9cf94b41df3 39 void enemyboss(N5110 &lcd);
RexRoshan 0:d9cf94b41df3 40
RexRoshan 0:d9cf94b41df3 41 /** Updates the movement
RexRoshan 0:d9cf94b41df3 42 * @brief Changes the movement of the enemy
RexRoshan 0:d9cf94b41df3 43 */
RexRoshan 0:d9cf94b41df3 44 void update();
RexRoshan 0:d9cf94b41df3 45
RexRoshan 0:d9cf94b41df3 46 /** Adds the value of health by 1
RexRoshan 0:d9cf94b41df3 47 *@brief Health for the boss
RexRoshan 0:d9cf94b41df3 48 */
RexRoshan 0:d9cf94b41df3 49 void add_health_boss();
RexRoshan 0:d9cf94b41df3 50
RexRoshan 0:d9cf94b41df3 51 /** Adds the value of health by 1
RexRoshan 0:d9cf94b41df3 52 *@brief Health for the first enemy
RexRoshan 0:d9cf94b41df3 53 */
RexRoshan 0:d9cf94b41df3 54 void add_health_enemy1();
RexRoshan 0:d9cf94b41df3 55
RexRoshan 0:d9cf94b41df3 56 /** Adds the value of health by 1
RexRoshan 0:d9cf94b41df3 57 *@brief Health for the second enemy
RexRoshan 0:d9cf94b41df3 58 */
RexRoshan 0:d9cf94b41df3 59 void add_health_enemy2();
RexRoshan 0:d9cf94b41df3 60
RexRoshan 0:d9cf94b41df3 61 /** Gets the value of the health
RexRoshan 0:d9cf94b41df3 62 * @brief returns the health of the boss
RexRoshan 0:d9cf94b41df3 63 * @returns value in range 0 to 10
RexRoshan 0:d9cf94b41df3 64 */
RexRoshan 0:d9cf94b41df3 65 int get_health_boss();
RexRoshan 0:d9cf94b41df3 66
RexRoshan 0:d9cf94b41df3 67 /** Gets the value of the health
RexRoshan 0:d9cf94b41df3 68 * @brief returns the health of the first enemy
RexRoshan 0:d9cf94b41df3 69 * @returns value in range 0 to 10
RexRoshan 0:d9cf94b41df3 70 */
RexRoshan 0:d9cf94b41df3 71 int get_health_enemy1();
RexRoshan 0:d9cf94b41df3 72
RexRoshan 0:d9cf94b41df3 73 /** Gets the value of the health
RexRoshan 0:d9cf94b41df3 74 * @brief returns the health of the second enemy
RexRoshan 0:d9cf94b41df3 75 * @returns value in range 0 to 10
RexRoshan 0:d9cf94b41df3 76 */
RexRoshan 0:d9cf94b41df3 77 int get_health_enemy2();
RexRoshan 0:d9cf94b41df3 78
RexRoshan 0:d9cf94b41df3 79 /** Sets the movement of the enemy
RexRoshan 0:d9cf94b41df3 80 * @param movement
RexRoshan 0:d9cf94b41df3 81 */
RexRoshan 0:d9cf94b41df3 82 void set_movement(Vector2D m);
RexRoshan 0:d9cf94b41df3 83
RexRoshan 0:d9cf94b41df3 84 /** Sets the position of the enemy
RexRoshan 0:d9cf94b41df3 85 * @brief Position of the boss
RexRoshan 0:d9cf94b41df3 86 * @param position
RexRoshan 0:d9cf94b41df3 87 */
RexRoshan 0:d9cf94b41df3 88 void set_enemyboss_pos(Vector2D e);
RexRoshan 0:d9cf94b41df3 89
RexRoshan 0:d9cf94b41df3 90 /** Sets the position of the enemy
RexRoshan 0:d9cf94b41df3 91 * @brief Position of the first enemy
RexRoshan 0:d9cf94b41df3 92 * @param position
RexRoshan 0:d9cf94b41df3 93 */
RexRoshan 0:d9cf94b41df3 94 void set_enemy1_pos(Vector2D d);
RexRoshan 0:d9cf94b41df3 95
RexRoshan 0:d9cf94b41df3 96 /** Sets the position of the enemy
RexRoshan 0:d9cf94b41df3 97 * @brief Position of the second enemy
RexRoshan 0:d9cf94b41df3 98 * @param position
RexRoshan 0:d9cf94b41df3 99 */
RexRoshan 0:d9cf94b41df3 100 void set_enemy2_pos(Vector2D c);
RexRoshan 0:d9cf94b41df3 101
RexRoshan 0:d9cf94b41df3 102 /** Gets the motion of the boss
RexRoshan 0:d9cf94b41df3 103 * @returns a struct with x,y members which corresponds to velocity in the x and y direction respectively
RexRoshan 0:d9cf94b41df3 104 */
RexRoshan 0:d9cf94b41df3 105 Vector2D motion();
RexRoshan 0:d9cf94b41df3 106
RexRoshan 0:d9cf94b41df3 107 /** Gets the position of the enemy
RexRoshan 0:d9cf94b41df3 108 * @brief Position of the boss
RexRoshan 0:d9cf94b41df3 109 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 110 */
RexRoshan 0:d9cf94b41df3 111 Vector2D get_enemyboss_pos();
RexRoshan 0:d9cf94b41df3 112
RexRoshan 0:d9cf94b41df3 113 /** Gets the position of the enemy
RexRoshan 0:d9cf94b41df3 114 * @brief Position of the first enemy
RexRoshan 0:d9cf94b41df3 115 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 116 */
RexRoshan 0:d9cf94b41df3 117 Vector2D get_enemy1_pos();
RexRoshan 0:d9cf94b41df3 118
RexRoshan 0:d9cf94b41df3 119 /** Gets the position of the enemy
RexRoshan 0:d9cf94b41df3 120 * @brief Position of the second enemy
RexRoshan 0:d9cf94b41df3 121 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 122 */
RexRoshan 0:d9cf94b41df3 123 Vector2D get_enemy2_pos();
RexRoshan 0:d9cf94b41df3 124
RexRoshan 0:d9cf94b41df3 125 /** Gets the movement of the boss
RexRoshan 0:d9cf94b41df3 126 * @returns a struct with x,y members which corresponds to x and y movement respectively
RexRoshan 0:d9cf94b41df3 127 */
RexRoshan 0:d9cf94b41df3 128 Vector2D get_movement();
RexRoshan 0:d9cf94b41df3 129
RexRoshan 0:d9cf94b41df3 130 private:
RexRoshan 0:d9cf94b41df3 131
RexRoshan 0:d9cf94b41df3 132 Vector2D _movement;
RexRoshan 0:d9cf94b41df3 133 int _a;
RexRoshan 0:d9cf94b41df3 134 int _b;
RexRoshan 0:d9cf94b41df3 135 int _c;
RexRoshan 0:d9cf94b41df3 136 int _d;
RexRoshan 0:d9cf94b41df3 137 int _e;
RexRoshan 0:d9cf94b41df3 138 int _f;
RexRoshan 0:d9cf94b41df3 139 int _direction;
RexRoshan 0:d9cf94b41df3 140 int _speed;
RexRoshan 0:d9cf94b41df3 141 int _health;
RexRoshan 0:d9cf94b41df3 142 int _health1;
RexRoshan 0:d9cf94b41df3 143 int _health2;
RexRoshan 0:d9cf94b41df3 144
RexRoshan 0:d9cf94b41df3 145 };
RexRoshan 0:d9cf94b41df3 146
RexRoshan 0:d9cf94b41df3 147 #endif