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