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 ENEMYBEAM3_H
RexRoshan 0:d9cf94b41df3 2 #define ENEMYBEAM3_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 "Spacecraft.h"
RexRoshan 0:d9cf94b41df3 8 #include "EnemyBoss.h"
RexRoshan 0:d9cf94b41df3 9
RexRoshan 0:d9cf94b41df3 10 // gap from edge of screen
RexRoshan 0:d9cf94b41df3 11 #define GAP 2
RexRoshan 0:d9cf94b41df3 12
RexRoshan 0:d9cf94b41df3 13 /** EnemyBeam3 Class
RexRoshan 0:d9cf94b41df3 14 * @brief Enemy beam in stage three
RexRoshan 0:d9cf94b41df3 15 * @author Rex Roshan Raj
RexRoshan 0:d9cf94b41df3 16 */
RexRoshan 0:d9cf94b41df3 17 class EnemyBeam3
RexRoshan 0:d9cf94b41df3 18 {
RexRoshan 0:d9cf94b41df3 19
RexRoshan 0:d9cf94b41df3 20 public:
RexRoshan 0:d9cf94b41df3 21
RexRoshan 0:d9cf94b41df3 22 /** Constructor */
RexRoshan 0:d9cf94b41df3 23 EnemyBeam3();
RexRoshan 0:d9cf94b41df3 24
RexRoshan 0:d9cf94b41df3 25 /** Destructor */
RexRoshan 0:d9cf94b41df3 26 ~EnemyBeam3();
RexRoshan 0:d9cf94b41df3 27
RexRoshan 0:d9cf94b41df3 28 /** Initialise the parameters for the enemy's beam in stage three
RexRoshan 0:d9cf94b41df3 29 *@param size - size of the beam
RexRoshan 0:d9cf94b41df3 30 *@param a - x position of the boss beam
RexRoshan 0:d9cf94b41df3 31 *@param b - y position of the boss beam
RexRoshan 0:d9cf94b41df3 32 *@param c - x position of the first enemy's beam
RexRoshan 0:d9cf94b41df3 33 *@param d - y position of the first enemy's beam
RexRoshan 0:d9cf94b41df3 34 *@param e - x position of the second enemy's beam
RexRoshan 0:d9cf94b41df3 35 *@param f - y position of the second enemy's beam
RexRoshan 0:d9cf94b41df3 36 */
RexRoshan 0:d9cf94b41df3 37 void init(int size,int a, int b, int c, int d,int e, int f);
RexRoshan 0:d9cf94b41df3 38
RexRoshan 0:d9cf94b41df3 39 /** Updates the beam
RexRoshan 0:d9cf94b41df3 40 * @brief Changes the x position of all the enemies beam once it has been initialised
RexRoshan 0:d9cf94b41df3 41 */
RexRoshan 0:d9cf94b41df3 42 void update();
RexRoshan 0:d9cf94b41df3 43
RexRoshan 0:d9cf94b41df3 44 /** Draws the enemy's beam
RexRoshan 0:d9cf94b41df3 45 * @brief Draws all three enemies
RexRoshan 0:d9cf94b41df3 46 * @param N5110 lcd
RexRoshan 0:d9cf94b41df3 47 */
RexRoshan 0:d9cf94b41df3 48 void draw(N5110 &lcd);
RexRoshan 0:d9cf94b41df3 49
RexRoshan 0:d9cf94b41df3 50 /** Gets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 51 * @brief Position of the boss beam
RexRoshan 0:d9cf94b41df3 52 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 53 */
RexRoshan 0:d9cf94b41df3 54 Vector2D get_pos_boss();
RexRoshan 0:d9cf94b41df3 55
RexRoshan 0:d9cf94b41df3 56 /** Gets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 57 * @brief Position of the first enemy beam
RexRoshan 0:d9cf94b41df3 58 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 59 */
RexRoshan 0:d9cf94b41df3 60 Vector2D get_pos_enemy1();
RexRoshan 0:d9cf94b41df3 61
RexRoshan 0:d9cf94b41df3 62 /** Gets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 63 * @brief Position of the second enemy beam
RexRoshan 0:d9cf94b41df3 64 * @returns a struct with x,y members which corresponds to x and y position respectively
RexRoshan 0:d9cf94b41df3 65 */
RexRoshan 0:d9cf94b41df3 66 Vector2D get_pos_enemy2();
RexRoshan 0:d9cf94b41df3 67
RexRoshan 0:d9cf94b41df3 68 /** Sets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 69 * @brief Position of the boss beam
RexRoshan 0:d9cf94b41df3 70 * @param position
RexRoshan 0:d9cf94b41df3 71 */
RexRoshan 0:d9cf94b41df3 72 void set_pos_boss(Vector2D p);
RexRoshan 0:d9cf94b41df3 73
RexRoshan 0:d9cf94b41df3 74 /** Sets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 75 * @brief Position of the first enemy's beam
RexRoshan 0:d9cf94b41df3 76 * @param position
RexRoshan 0:d9cf94b41df3 77 */
RexRoshan 0:d9cf94b41df3 78 void set_pos_enemy1(Vector2D p);
RexRoshan 0:d9cf94b41df3 79
RexRoshan 0:d9cf94b41df3 80 /** Sets the position of the enemy's beam
RexRoshan 0:d9cf94b41df3 81 * @brief Position of the second enemy's beam
RexRoshan 0:d9cf94b41df3 82 * @param position
RexRoshan 0:d9cf94b41df3 83 */
RexRoshan 0:d9cf94b41df3 84 void set_pos_enemy2(Vector2D p);
RexRoshan 0:d9cf94b41df3 85
RexRoshan 0:d9cf94b41df3 86 private:
RexRoshan 0:d9cf94b41df3 87
RexRoshan 0:d9cf94b41df3 88 Spacecraft _p1;
RexRoshan 0:d9cf94b41df3 89 EnemyBoss _e3;
RexRoshan 0:d9cf94b41df3 90
RexRoshan 0:d9cf94b41df3 91 int _speed;
RexRoshan 0:d9cf94b41df3 92 int _size;
RexRoshan 0:d9cf94b41df3 93
RexRoshan 0:d9cf94b41df3 94 int _x;
RexRoshan 0:d9cf94b41df3 95 int _y;
RexRoshan 0:d9cf94b41df3 96 int _a;
RexRoshan 0:d9cf94b41df3 97 int _b;
RexRoshan 0:d9cf94b41df3 98 int _c;
RexRoshan 0:d9cf94b41df3 99 int _d;
RexRoshan 0:d9cf94b41df3 100 int _e;
RexRoshan 0:d9cf94b41df3 101 int _f;
RexRoshan 0:d9cf94b41df3 102
RexRoshan 0:d9cf94b41df3 103 };
RexRoshan 0:d9cf94b41df3 104
RexRoshan 0:d9cf94b41df3 105 #endif