ELEC2645 (2018/19) / Mbed 2 deprecated el17m2h_public

Dependencies:   mbed

Committer:
el17m2h
Date:
Wed Apr 17 16:58:01 2019 +0000
Revision:
11:2041290b5a74
Parent:
10:e1d2289705ef
Child:
12:c5123abb4fbe
I added a function in the engine cpp to shift the floors when the doodler goes beyond the middle. I also added a function in the floors cpp that will check if the floors leave the screen so that it will move the floor to the top and in a random x-pos

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 11:2041290b5a74 13 void init(int y, int width, int height);
el17m2h 1:0001cb3eb053 14 void draw(N5110 &lcd);
el17m2h 10:e1d2289705ef 15 void update(Vector2D current_pos);
el17m2h 1:0001cb3eb053 16 Vector2D get_pos();
el17m2h 1:0001cb3eb053 17 void set_pos(Vector2D p); // mutators
el17m2h 1:0001cb3eb053 18
el17m2h 1:0001cb3eb053 19 private:
el17m2h 1:0001cb3eb053 20 int _height;
el17m2h 1:0001cb3eb053 21 int _width;
el17m2h 9:5e53bca2a4c2 22 Vector2D _pos;
el17m2h 1:0001cb3eb053 23
el17m2h 1:0001cb3eb053 24 };
el17m2h 1:0001cb3eb053 25 #endif