ELEC2645 (2019/20) / Mbed 2 deprecated ELEC2645_Project_el18jkeo

Dependencies:   mbed

Committer:
josh_ohara
Date:
Sun Mar 22 18:51:00 2020 +0000
Revision:
4:18a1fc4c38e0
Parent:
3:8a140aa1ddcd
Child:
5:e5bb95fb308b
Adding variables to control lives of aliens and ship and rock components

Who changed what in which revision?

UserRevisionLine numberNew contents of line
josh_ohara 2:c2316b659b97 1
josh_ohara 3:8a140aa1ddcd 2 #include "mbed.h"
josh_ohara 3:8a140aa1ddcd 3 #include "N5110.h"
josh_ohara 3:8a140aa1ddcd 4 #include "Gamepad.h"
josh_ohara 2:c2316b659b97 5
josh_ohara 2:c2316b659b97 6 class Ship
josh_ohara 2:c2316b659b97 7 {
josh_ohara 2:c2316b659b97 8
josh_ohara 2:c2316b659b97 9 public:
josh_ohara 2:c2316b659b97 10 void init(int y, int height, int width); //dimensions of the ship without shooter, y position is bottom of the screen
josh_ohara 2:c2316b659b97 11 void draw(N5110 &lcd); //Draws basic rectangle ship
josh_ohara 3:8a140aa1ddcd 12 Vector2D get_position(); //Returns position of ship
josh_ohara 2:c2316b659b97 13 void update(Direction d,float mag); //Interface between joystick and ship control
josh_ohara 3:8a140aa1ddcd 14 int get_height();
josh_ohara 3:8a140aa1ddcd 15 int get_width();
josh_ohara 4:18a1fc4c38e0 16 void set_life(int l);
josh_ohara 2:c2316b659b97 17
josh_ohara 2:c2316b659b97 18 private:
josh_ohara 2:c2316b659b97 19 int Height;
josh_ohara 2:c2316b659b97 20 int Width;
josh_ohara 2:c2316b659b97 21 int X;
josh_ohara 2:c2316b659b97 22 int Y; //y value of ship
josh_ohara 2:c2316b659b97 23 int Speed; //speed of ship
josh_ohara 4:18a1fc4c38e0 24 bool Life;
josh_ohara 2:c2316b659b97 25 };