ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Committer:
el17m2h
Date:
Tue Apr 16 16:16:08 2019 +0000
Revision:
8:90e789413e0b
Parent:
5:8814d6de77d0
Child:
9:5e53bca2a4c2
Changed the update function in the doodler so that it will be reading the position and velocity and setting a new one every time it updates (so that I will not have to write it in the engine file).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
el17m2h 1:0001cb3eb053 1 #ifndef FLOORS_H
el17m2h 1:0001cb3eb053 2 #define FLOORS_H
el17m2h 1:0001cb3eb053 3
el17m2h 1:0001cb3eb053 4 #include "mbed.h"
el17m2h 1:0001cb3eb053 5 #include "N5110.h"
el17m2h 1:0001cb3eb053 6 #include "Gamepad.h"
el17m2h 8:90e789413e0b 7 #include "Doodler.h"
el17m2h 8:90e789413e0b 8
el17m2h 1:0001cb3eb053 9 class Floors{
el17m2h 1:0001cb3eb053 10 public:
el17m2h 1:0001cb3eb053 11 Floors();
el17m2h 1:0001cb3eb053 12 ~Floors();
el17m2h 3:116913e97fd7 13 void init(int x, int y, int width, int height);
el17m2h 1:0001cb3eb053 14 void draw(N5110 &lcd);
el17m2h 5:8814d6de77d0 15 void update();
el17m2h 1:0001cb3eb053 16 Vector2D get_velocity(); //accesors
el17m2h 1:0001cb3eb053 17 Vector2D get_pos();
el17m2h 1:0001cb3eb053 18 void set_pos(Vector2D p); // mutators
el17m2h 1:0001cb3eb053 19 void set_velocity (Vector2D v);
el17m2h 1:0001cb3eb053 20
el17m2h 1:0001cb3eb053 21 private:
el17m2h 1:0001cb3eb053 22 int _height;
el17m2h 1:0001cb3eb053 23 int _width;
el17m2h 1:0001cb3eb053 24 int _x;
el17m2h 1:0001cb3eb053 25 int _y;
el17m2h 1:0001cb3eb053 26 Vector2D _velocity;
el17m2h 8:90e789413e0b 27 Vector2D _current_vel;
el17m2h 8:90e789413e0b 28 Vector2D _new_vel;
el17m2h 8:90e789413e0b 29 Vector2D _current_pos;
el17m2h 8:90e789413e0b 30 Vector2D _new_pos;
el17m2h 1:0001cb3eb053 31
el17m2h 1:0001cb3eb053 32 };
el17m2h 1:0001cb3eb053 33 #endif