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/PeopleEngine.h@3:b8fbaefc496c, 2020-04-12 (annotated)
- Committer:
- el19zf
- Date:
- Sun Apr 12 12:56:49 2020 +0000
- Revision:
- 3:b8fbaefc496c
- Parent:
- 2:67b51ee7fc34
- Child:
- 4:b12a49f0b730
build a control method for the basic element 'people'
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| el19zf | 2:67b51ee7fc34 | 1 | #ifndef PEOPLEENGINE_H |
| el19zf | 2:67b51ee7fc34 | 2 | #define PEOPLEENGINE_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 | #include "People.h" |
| el19zf | 2:67b51ee7fc34 | 8 | |
| el19zf | 3:b8fbaefc496c | 9 | /** People class |
| el19zf | 3:b8fbaefc496c | 10 | @set a Engine of 'People' and do some basic check |
| el19zf | 3:b8fbaefc496c | 11 | @author Zeyu Feng |
| el19zf | 3:b8fbaefc496c | 12 | @date April 2020 |
| el19zf | 3:b8fbaefc496c | 13 | */ |
| el19zf | 2:67b51ee7fc34 | 14 | |
| el19zf | 3:b8fbaefc496c | 15 | class PeopleEngine |
| el19zf | 3:b8fbaefc496c | 16 | { |
| el19zf | 3:b8fbaefc496c | 17 | |
| el19zf | 3:b8fbaefc496c | 18 | public: |
| el19zf | 3:b8fbaefc496c | 19 | PeopleEngine();//constructor |
| el19zf | 3:b8fbaefc496c | 20 | ~PeopleEngine();//destructor |
| el19zf | 3:b8fbaefc496c | 21 | |
| el19zf | 3:b8fbaefc496c | 22 | void init(); |
| el19zf | 3:b8fbaefc496c | 23 | void read_input(Gamepad &pad); |
| el19zf | 3:b8fbaefc496c | 24 | void update(); |
| el19zf | 3:b8fbaefc496c | 25 | void draw(N5110 &lcd); |
| el19zf | 3:b8fbaefc496c | 26 | |
| el19zf | 3:b8fbaefc496c | 27 | private: |
| el19zf | 3:b8fbaefc496c | 28 | |
| el19zf | 3:b8fbaefc496c | 29 | People _people; |
| el19zf | 3:b8fbaefc496c | 30 | Direction _d; |
| el19zf | 3:b8fbaefc496c | 31 | Vector2D _p; |
| el19zf | 3:b8fbaefc496c | 32 | float _mag; |
| el19zf | 3:b8fbaefc496c | 33 | |
| el19zf | 3:b8fbaefc496c | 34 | }; |
| el19zf | 3:b8fbaefc496c | 35 | #endif |
| el19zf | 3:b8fbaefc496c | 36 | |
| el19zf | 3:b8fbaefc496c | 37 | |
| el19zf | 3:b8fbaefc496c | 38 |