The game is finished

Dependencies:   mbed Gamepad N5110 mbed-rtos

Committer:
RexRoshan
Date:
Thu May 09 14:23:35 2019 +0000
Revision:
14:c7302ffe6eab
Parent:
13:a2f061b9cc36
Final Modification

Who changed what in which revision?

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