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
Doodler/Doodler.h@4:8ec314f806ae, 2019-04-11 (annotated)
- Committer:
- el17m2h
- Date:
- Thu Apr 11 14:44:14 2019 +0000
- Revision:
- 4:8ec314f806ae
- Child:
- 5:8814d6de77d0
Added a doodler that will be controlled by the user using the joystick.
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el17m2h | 4:8ec314f806ae | 1 | #ifndef DOODLER_H |
| el17m2h | 4:8ec314f806ae | 2 | #define DOODLER_H |
| el17m2h | 4:8ec314f806ae | 3 | |
| el17m2h | 4:8ec314f806ae | 4 | #include "mbed.h" |
| el17m2h | 4:8ec314f806ae | 5 | #include "N5110.h" |
| el17m2h | 4:8ec314f806ae | 6 | #include "Gamepad.h" |
| el17m2h | 4:8ec314f806ae | 7 | #include "Floors.h" |
| el17m2h | 4:8ec314f806ae | 8 | class Doodler{ |
| el17m2h | 4:8ec314f806ae | 9 | public: |
| el17m2h | 4:8ec314f806ae | 10 | Doodler(); |
| el17m2h | 4:8ec314f806ae | 11 | ~Doodler(); |
| el17m2h | 4:8ec314f806ae | 12 | void init(int x, int y, int radius); |
| el17m2h | 4:8ec314f806ae | 13 | void draw(N5110 &lcd); |
| el17m2h | 4:8ec314f806ae | 14 | Vector2D get_velocity(); //accesors |
| el17m2h | 4:8ec314f806ae | 15 | Vector2D get_pos(); |
| el17m2h | 4:8ec314f806ae | 16 | void set_pos(Vector2D p); // mutators |
| el17m2h | 4:8ec314f806ae | 17 | void set_velocity (Vector2D v); |
| el17m2h | 4:8ec314f806ae | 18 | |
| el17m2h | 4:8ec314f806ae | 19 | private: |
| el17m2h | 4:8ec314f806ae | 20 | int _radius; |
| el17m2h | 4:8ec314f806ae | 21 | int _x; |
| el17m2h | 4:8ec314f806ae | 22 | int _y; |
| el17m2h | 4:8ec314f806ae | 23 | Vector2D _velocity; |
| el17m2h | 4:8ec314f806ae | 24 | |
| el17m2h | 4:8ec314f806ae | 25 | }; |
| el17m2h | 4:8ec314f806ae | 26 | #endif |