Rex Raj / Mbed 2 deprecated el17rrrs

Dependencies:   mbed Gamepad N5110 mbed-rtos

Committer:
RexRoshan
Date:
Thu May 09 12:23:00 2019 +0000
Revision:
9:c5a19e358c07
Parent:
7:574c66ebd8b0
Child:
10:f44b43ed1a06
-

Who changed what in which revision?

UserRevisionLine numberNew contents of line
RexRoshan 7:574c66ebd8b0 1 #ifndef MINIENEMY_H
RexRoshan 7:574c66ebd8b0 2 #define MINIENEMY_H
RexRoshan 7:574c66ebd8b0 3
RexRoshan 7:574c66ebd8b0 4 #include "mbed.h"
RexRoshan 7:574c66ebd8b0 5 #include "N5110.h"
RexRoshan 7:574c66ebd8b0 6 #include "Gamepad.h"
RexRoshan 7:574c66ebd8b0 7
RexRoshan 7:574c66ebd8b0 8 /** MiniEnemy Class
RexRoshan 7:574c66ebd8b0 9 * @brief Enemy for the minigame
RexRoshan 7:574c66ebd8b0 10 * @author Rex Roshan Raj
RexRoshan 7:574c66ebd8b0 11 */
RexRoshan 9:c5a19e358c07 12
RexRoshan 7:574c66ebd8b0 13 class MiniEnemy
RexRoshan 7:574c66ebd8b0 14 {
RexRoshan 7:574c66ebd8b0 15
RexRoshan 7:574c66ebd8b0 16 public:
RexRoshan 7:574c66ebd8b0 17 /** Constructor */
RexRoshan 7:574c66ebd8b0 18 MiniEnemy();
RexRoshan 7:574c66ebd8b0 19
RexRoshan 7:574c66ebd8b0 20 /** Destructor */
RexRoshan 7:574c66ebd8b0 21 ~MiniEnemy();
RexRoshan 7:574c66ebd8b0 22
RexRoshan 7:574c66ebd8b0 23 /** Initialises the parameters */
RexRoshan 7:574c66ebd8b0 24 void init();
RexRoshan 7:574c66ebd8b0 25
RexRoshan 7:574c66ebd8b0 26 /** Generates the location
RexRoshan 7:574c66ebd8b0 27 * @brief Generates and sets the location of the enemy once it has been hit
RexRoshan 7:574c66ebd8b0 28 */
RexRoshan 7:574c66ebd8b0 29 Vector2D location();
RexRoshan 7:574c66ebd8b0 30
RexRoshan 7:574c66ebd8b0 31 /** Draws the enemy
RexRoshan 7:574c66ebd8b0 32 * @param N5110 lcd
RexRoshan 7:574c66ebd8b0 33 * @brief Draws the enemy in stage one
RexRoshan 7:574c66ebd8b0 34 */
RexRoshan 7:574c66ebd8b0 35 void enemy(N5110 &lcd);
RexRoshan 7:574c66ebd8b0 36
RexRoshan 7:574c66ebd8b0 37 /** Updates the movement
RexRoshan 7:574c66ebd8b0 38 * @brief Changes the y position for animation once the enemy has died
RexRoshan 7:574c66ebd8b0 39 */
RexRoshan 7:574c66ebd8b0 40 void update();
RexRoshan 7:574c66ebd8b0 41
RexRoshan 7:574c66ebd8b0 42 /** Adds the value of score by 1 */
RexRoshan 7:574c66ebd8b0 43 void add_score();
RexRoshan 7:574c66ebd8b0 44
RexRoshan 7:574c66ebd8b0 45 /** Gets the value of the score
RexRoshan 7:574c66ebd8b0 46 * @returns value in range 0 to 10
RexRoshan 7:574c66ebd8b0 47 */
RexRoshan 7:574c66ebd8b0 48 int get_score();
RexRoshan 7:574c66ebd8b0 49
RexRoshan 7:574c66ebd8b0 50 /** Adds the value of health by 1 */
RexRoshan 7:574c66ebd8b0 51 void add_health();
RexRoshan 7:574c66ebd8b0 52
RexRoshan 7:574c66ebd8b0 53 /** Gets the value of the health
RexRoshan 7:574c66ebd8b0 54 * @returns value in range 0 to 5
RexRoshan 7:574c66ebd8b0 55 */
RexRoshan 7:574c66ebd8b0 56 int get_health();
RexRoshan 7:574c66ebd8b0 57
RexRoshan 7:574c66ebd8b0 58 /** Sets the value of the health
RexRoshan 7:574c66ebd8b0 59 * @returns value of 0
RexRoshan 7:574c66ebd8b0 60 */
RexRoshan 7:574c66ebd8b0 61 int set_health();
RexRoshan 7:574c66ebd8b0 62
RexRoshan 7:574c66ebd8b0 63 /** Adds 1 to movement speed*/
RexRoshan 7:574c66ebd8b0 64 void add_fast();
RexRoshan 7:574c66ebd8b0 65
RexRoshan 7:574c66ebd8b0 66 /** Gets the value of the fast
RexRoshan 7:574c66ebd8b0 67 * @returns value in range 1 to 7
RexRoshan 7:574c66ebd8b0 68 */
RexRoshan 7:574c66ebd8b0 69 int get_fast();
RexRoshan 7:574c66ebd8b0 70
RexRoshan 7:574c66ebd8b0 71 /** Sets the value of the fast
RexRoshan 7:574c66ebd8b0 72 * @returns value in range 0
RexRoshan 7:574c66ebd8b0 73 */
RexRoshan 7:574c66ebd8b0 74 int set_fast();
RexRoshan 7:574c66ebd8b0 75
RexRoshan 7:574c66ebd8b0 76 /** Gets the position of the enemy
RexRoshan 7:574c66ebd8b0 77 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 7:574c66ebd8b0 78 */
RexRoshan 7:574c66ebd8b0 79 Vector2D get_enemy_pos();
RexRoshan 7:574c66ebd8b0 80
RexRoshan 7:574c66ebd8b0 81 /** Sets the position of the enemy
RexRoshan 7:574c66ebd8b0 82 * @param position of the enemy
RexRoshan 7:574c66ebd8b0 83 */
RexRoshan 7:574c66ebd8b0 84 void set_enemy_pos(Vector2D e);
RexRoshan 7:574c66ebd8b0 85
RexRoshan 7:574c66ebd8b0 86
RexRoshan 7:574c66ebd8b0 87 private:
RexRoshan 7:574c66ebd8b0 88
RexRoshan 7:574c66ebd8b0 89 // methods
RexRoshan 7:574c66ebd8b0 90 Vector2D _location;
RexRoshan 7:574c66ebd8b0 91 int a;
RexRoshan 7:574c66ebd8b0 92 int b;
RexRoshan 7:574c66ebd8b0 93 int x;
RexRoshan 7:574c66ebd8b0 94 int y;
RexRoshan 7:574c66ebd8b0 95 int _fast;
RexRoshan 7:574c66ebd8b0 96 int _score;
RexRoshan 7:574c66ebd8b0 97 int _health;
RexRoshan 7:574c66ebd8b0 98
RexRoshan 7:574c66ebd8b0 99 };
RexRoshan 7:574c66ebd8b0 100
RexRoshan 7:574c66ebd8b0 101 #endif