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@5:8814d6de77d0, 2019-04-13 (annotated)
- Committer:
- el17m2h
- Date:
- Sat Apr 13 17:37:52 2019 +0000
- Revision:
- 5:8814d6de77d0
- Parent:
- 3:116913e97fd7
- Child:
- 8:90e789413e0b
Created an update function for the doodler to change its position depending on the user moving the joystick left or right.
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 | 3:116913e97fd7 | 11 | void init(int x, int y, int width, int height); |
el17m2h | 1:0001cb3eb053 | 12 | void draw(N5110 &lcd); |
el17m2h | 5:8814d6de77d0 | 13 | void update(); |
el17m2h | 1:0001cb3eb053 | 14 | Vector2D get_velocity(); //accesors |
el17m2h | 1:0001cb3eb053 | 15 | Vector2D get_pos(); |
el17m2h | 1:0001cb3eb053 | 16 | void set_pos(Vector2D p); // mutators |
el17m2h | 1:0001cb3eb053 | 17 | void set_velocity (Vector2D v); |
el17m2h | 1:0001cb3eb053 | 18 | |
el17m2h | 1:0001cb3eb053 | 19 | private: |
el17m2h | 1:0001cb3eb053 | 20 | int _height; |
el17m2h | 1:0001cb3eb053 | 21 | int _width; |
el17m2h | 1:0001cb3eb053 | 22 | int _x; |
el17m2h | 1:0001cb3eb053 | 23 | int _y; |
el17m2h | 1:0001cb3eb053 | 24 | Vector2D _velocity; |
el17m2h | 1:0001cb3eb053 | 25 | |
el17m2h | 1:0001cb3eb053 | 26 | }; |
el17m2h | 1:0001cb3eb053 | 27 | #endif |