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
Fighter/Fighter.h@2:cb2fd25433ee, 2020-05-23 (annotated)
- Committer:
- ChenZirui
- Date:
- Sat May 23 06:26:21 2020 +0000
- Revision:
- 2:cb2fd25433ee
rename
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ChenZirui | 2:cb2fd25433ee | 1 | #ifndef FIGHTER_H |
ChenZirui | 2:cb2fd25433ee | 2 | #define FIGHTER_H |
ChenZirui | 2:cb2fd25433ee | 3 | |
ChenZirui | 2:cb2fd25433ee | 4 | #include "mbed.h" |
ChenZirui | 2:cb2fd25433ee | 5 | #include "N5510.h" |
ChenZirui | 2:cb2fd25433ee | 6 | #include "Gamepad.h" |
ChenZirui | 2:cb2fd25433ee | 7 | |
ChenZirui | 2:cb2fd25433ee | 8 | class fighter |
ChenZirui | 2:cb2fd25433ee | 9 | { |
ChenZirui | 2:cb2fd25433ee | 10 | |
ChenZirui | 2:cb2fd25433ee | 11 | public: |
ChenZirui | 2:cb2fd25433ee | 12 | |
ChenZirui | 2:cb2fd25433ee | 13 | fighter(); |
ChenZirui | 2:cb2fd25433ee | 14 | ~fighter(); |
ChenZirui | 2:cb2fd25433ee | 15 | void init(int x,int y,int height,int width); |
ChenZirui | 2:cb2fd25433ee | 16 | void draw(N5110 &lcd); |
ChenZirui | 2:cb2fd25433ee | 17 | void update(Direction d,float mag); |
ChenZirui | 2:cb2fd25433ee | 18 | void add_score(); |
ChenZirui | 2:cb2fd25433ee | 19 | int get_score(); |
ChenZirui | 2:cb2fd25433ee | 20 | Vector2D get_pos(); |
ChenZirui | 2:cb2fd25433ee | 21 | |
ChenZirui | 2:cb2fd25433ee | 22 | private: |
ChenZirui | 2:cb2fd25433ee | 23 | |
ChenZirui | 2:cb2fd25433ee | 24 | int _height; |
ChenZirui | 2:cb2fd25433ee | 25 | int _width; |
ChenZirui | 2:cb2fd25433ee | 26 | int _x; |
ChenZirui | 2:cb2fd25433ee | 27 | int _y; |
ChenZirui | 2:cb2fd25433ee | 28 | int _speed; |
ChenZirui | 2:cb2fd25433ee | 29 | int _score; |
ChenZirui | 2:cb2fd25433ee | 30 | |
ChenZirui | 2:cb2fd25433ee | 31 | }; |