ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Committer:
josh_ohara
Date:
Fri May 01 19:41:24 2020 +0000
Revision:
20:0b6f1cfc5be6
Parent:
8:86cb9a9f8a73
Child:
21:970807533b10
Aliens now return fire. Alien bullets now interact with ship and cover. Next to set levels and menus.

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 2:c2316b659b97 7
josh_ohara 2:c2316b659b97 8 class Ship
josh_ohara 2:c2316b659b97 9 {
josh_ohara 2:c2316b659b97 10
josh_ohara 2:c2316b659b97 11 public:
josh_ohara 8:86cb9a9f8a73 12 Ship();
josh_ohara 8:86cb9a9f8a73 13 ~Ship();
josh_ohara 8:86cb9a9f8a73 14 void init(int height, int width); //dimensions of the ship without shooter, y position is bottom of the screen
josh_ohara 8:86cb9a9f8a73 15 void render(N5110 &lcd); //Draws basic rectangle ship
josh_ohara 6:5bea67cc96f9 16 Vector2D get_position(); //Returns position of ship
josh_ohara 6:5bea67cc96f9 17 void update(Direction d, float mag); //Interface between joystick and ship control
josh_ohara 3:8a140aa1ddcd 18 int get_height();
josh_ohara 3:8a140aa1ddcd 19 int get_width();
josh_ohara 20:0b6f1cfc5be6 20 void set_life(bool life);
josh_ohara 2:c2316b659b97 21
josh_ohara 2:c2316b659b97 22 private:
josh_ohara 2:c2316b659b97 23 int Height;
josh_ohara 2:c2316b659b97 24 int Width;
josh_ohara 2:c2316b659b97 25 int X;
josh_ohara 6:5bea67cc96f9 26 int Y; //y value of ship
josh_ohara 6:5bea67cc96f9 27 int Speed; //speed of ship
josh_ohara 20:0b6f1cfc5be6 28 bool Life;
josh_ohara 2:c2316b659b97 29 };
josh_ohara 8:86cb9a9f8a73 30
josh_ohara 8:86cb9a9f8a73 31 #endif