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
PeopleEngine/People.h@9:62d6559f0d50, 2020-05-09 (annotated)
- Committer:
- el19zf
- Date:
- Sat May 09 08:27:07 2020 +0000
- Revision:
- 9:62d6559f0d50
- Parent:
- People/People.h@4:b12a49f0b730
- Child:
- 11:494cc44777fe
update mechanism of game, make harder
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el19zf | 2:67b51ee7fc34 | 1 | /** People class |
| el19zf | 2:67b51ee7fc34 | 2 | @set a basic element of my project |
| el19zf | 2:67b51ee7fc34 | 3 | @author Zeyu Feng |
| el19zf | 4:b12a49f0b730 | 4 | @9 April 2020 |
| el19zf | 2:67b51ee7fc34 | 5 | */ |
| el19zf | 2:67b51ee7fc34 | 6 | #ifndef PEOPLE_H |
| el19zf | 2:67b51ee7fc34 | 7 | #define PEOPLE_H |
| el19zf | 2:67b51ee7fc34 | 8 | |
| el19zf | 2:67b51ee7fc34 | 9 | #include "mbed.h" |
| el19zf | 2:67b51ee7fc34 | 10 | #include "Gamepad.h" |
| el19zf | 2:67b51ee7fc34 | 11 | #include "N5110.h" |
| el19zf | 2:67b51ee7fc34 | 12 | |
| el19zf | 2:67b51ee7fc34 | 13 | class People { |
| el19zf | 2:67b51ee7fc34 | 14 | |
| el19zf | 2:67b51ee7fc34 | 15 | public: |
| el19zf | 2:67b51ee7fc34 | 16 | People(); //Constructor |
| el19zf | 2:67b51ee7fc34 | 17 | |
| el19zf | 2:67b51ee7fc34 | 18 | ~People(); //Destructor |
| el19zf | 2:67b51ee7fc34 | 19 | |
| el19zf | 2:67b51ee7fc34 | 20 | void init(); |
| el19zf | 2:67b51ee7fc34 | 21 | |
| el19zf | 2:67b51ee7fc34 | 22 | void draw(N5110 &lcd); |
| el19zf | 2:67b51ee7fc34 | 23 | |
| el19zf | 2:67b51ee7fc34 | 24 | void update(); |
| el19zf | 2:67b51ee7fc34 | 25 | |
| el19zf | 2:67b51ee7fc34 | 26 | //accessors |
| el19zf | 2:67b51ee7fc34 | 27 | void set_pos(Vector2D p); |
| el19zf | 2:67b51ee7fc34 | 28 | |
| el19zf | 3:b8fbaefc496c | 29 | void set_velocity(Direction d,float mag); |
| el19zf | 2:67b51ee7fc34 | 30 | |
| el19zf | 2:67b51ee7fc34 | 31 | //mutators |
| el19zf | 2:67b51ee7fc34 | 32 | Vector2D get_pos(); |
| el19zf | 3:b8fbaefc496c | 33 | |
| el19zf | 2:67b51ee7fc34 | 34 | private: |
| el19zf | 3:b8fbaefc496c | 35 | Direction _d; |
| el19zf | 3:b8fbaefc496c | 36 | float _mag; |
| el19zf | 2:67b51ee7fc34 | 37 | int _x; |
| el19zf | 2:67b51ee7fc34 | 38 | int _y; |
| el19zf | 2:67b51ee7fc34 | 39 | }; |
| el19zf | 2:67b51ee7fc34 | 40 | #endif |
| el19zf | 2:67b51ee7fc34 | 41 |