ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Committer:
josh_ohara
Date:
Fri May 15 15:45:38 2020 +0000
Revision:
25:823b1a997a0c
Parent:
21:970807533b10
Child:
26:31a729ec7e76
irrelevant commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
josh_ohara 8:86cb9a9f8a73 1 #ifndef SHIP_H
josh_ohara 8:86cb9a9f8a73 2 #define SHIP_H
josh_ohara 2:c2316b659b97 3
josh_ohara 3:8a140aa1ddcd 4 #include "mbed.h"
josh_ohara 3:8a140aa1ddcd 5 #include "N5110.h"
josh_ohara 3:8a140aa1ddcd 6 #include "Gamepad.h"
josh_ohara 21:970807533b10 7 #include "BulletS.h"
josh_ohara 2:c2316b659b97 8
josh_ohara 25:823b1a997a0c 9 /** Ship Class
josh_ohara 25:823b1a997a0c 10 @author Joshua Ohara, el18jkeo, 201291390
josh_ohara 25:823b1a997a0c 11 @brief Controls the ship
josh_ohara 25:823b1a997a0c 12 @date May 2020
josh_ohara 25:823b1a997a0c 13 */
josh_ohara 25:823b1a997a0c 14
josh_ohara 2:c2316b659b97 15 class Ship
josh_ohara 2:c2316b659b97 16 {
josh_ohara 2:c2316b659b97 17
josh_ohara 2:c2316b659b97 18 public:
josh_ohara 25:823b1a997a0c 19 /** Constructor */
josh_ohara 8:86cb9a9f8a73 20 Ship();
josh_ohara 25:823b1a997a0c 21 /** Destructor */
josh_ohara 8:86cb9a9f8a73 22 ~Ship();
josh_ohara 25:823b1a997a0c 23 /** Set the score
josh_ohara 25:823b1a997a0c 24 * @param the value of the score (int)
josh_ohara 25:823b1a997a0c 25 */
josh_ohara 8:86cb9a9f8a73 26 void init(int height, int width); //dimensions of the ship without shooter, y position is bottom of the screen
josh_ohara 8:86cb9a9f8a73 27 void render(N5110 &lcd); //Draws basic rectangle ship
josh_ohara 6:5bea67cc96f9 28 Vector2D get_position(); //Returns position of ship
josh_ohara 21:970807533b10 29 void update(Direction d, float mag, Gamepad &pad, N5110 &lcd, int counter); //Interface between joystick and ship control
josh_ohara 3:8a140aa1ddcd 30 int get_height();
josh_ohara 3:8a140aa1ddcd 31 int get_width();
josh_ohara 20:0b6f1cfc5be6 32 void set_life(bool life);
josh_ohara 21:970807533b10 33 bool get_life();
josh_ohara 21:970807533b10 34 vector<Bullet> get_bullet_vector();
josh_ohara 21:970807533b10 35 void set_bullet_hit(int i, bool hit);
josh_ohara 2:c2316b659b97 36
josh_ohara 2:c2316b659b97 37 private:
josh_ohara 2:c2316b659b97 38 int Height;
josh_ohara 2:c2316b659b97 39 int Width;
josh_ohara 2:c2316b659b97 40 int X;
josh_ohara 25:823b1a997a0c 41 int Y;
josh_ohara 25:823b1a997a0c 42 int Speed;
josh_ohara 20:0b6f1cfc5be6 43 bool Life;
josh_ohara 21:970807533b10 44 BulletS ship_bullet_vector;
josh_ohara 2:c2316b659b97 45 };
josh_ohara 8:86cb9a9f8a73 46
josh_ohara 8:86cb9a9f8a73 47 #endif