Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Floors/Floors.h@2:360a6c301a4e, 2019-04-10 (annotated)
- Committer:
- el17m2h
- Date:
- Wed Apr 10 17:34:02 2019 +0000
- Revision:
- 2:360a6c301a4e
- Parent:
- 1:0001cb3eb053
- Child:
- 3:116913e97fd7
I created an engine .cpp and .h file to add 10 floors to the screen once the button start is pressed and I used the rand syntax to place them in random positions within the screen
Who changed what in which revision?
User | Revision | Line number | New 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 | 1:0001cb3eb053 | 7 | class Floors{ |
el17m2h | 1:0001cb3eb053 | 8 | public: |
el17m2h | 1:0001cb3eb053 | 9 | Floors(); |
el17m2h | 1:0001cb3eb053 | 10 | ~Floors(); |
el17m2h | 2:360a6c301a4e | 11 | void init(int x, int y, int height, int width); |
el17m2h | 1:0001cb3eb053 | 12 | void draw(N5110 &lcd); |
el17m2h | 1:0001cb3eb053 | 13 | Vector2D get_velocity(); //accesors |
el17m2h | 1:0001cb3eb053 | 14 | Vector2D get_pos(); |
el17m2h | 1:0001cb3eb053 | 15 | void set_pos(Vector2D p); // mutators |
el17m2h | 1:0001cb3eb053 | 16 | void set_velocity (Vector2D v); |
el17m2h | 1:0001cb3eb053 | 17 | |
el17m2h | 1:0001cb3eb053 | 18 | private: |
el17m2h | 1:0001cb3eb053 | 19 | int _height; |
el17m2h | 1:0001cb3eb053 | 20 | int _width; |
el17m2h | 1:0001cb3eb053 | 21 | int _x; |
el17m2h | 1:0001cb3eb053 | 22 | int _y; |
el17m2h | 1:0001cb3eb053 | 23 | Vector2D _velocity; |
el17m2h | 1:0001cb3eb053 | 24 | |
el17m2h | 1:0001cb3eb053 | 25 | }; |
el17m2h | 1:0001cb3eb053 | 26 | #endif |