zhenye yang
/
el17zy
Yang Zhenye 201199680
RoonyEngine/RoonyEngine.h@3:30c81344beff, 2020-05-08 (annotated)
- Committer:
- yangzhenye
- Date:
- Fri May 08 09:09:49 2020 +0000
- Revision:
- 3:30c81344beff
- Parent:
- 2:baca89f466bc
improve project
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangzhenye | 3:30c81344beff | 1 | #ifndef "ROONYENGINE" |
yangzhenye | 3:30c81344beff | 2 | #define "ROONYENGINE" |
yangzhenye | 3:30c81344beff | 3 | |
yangzhenye | 3:30c81344beff | 4 | #include "mbed.h" |
yangzhenye | 3:30c81344beff | 5 | #include "N5110.h" |
yangzhenye | 3:30c81344beff | 6 | #include "Gamepad.h" |
yangzhenye | 3:30c81344beff | 7 | #include "Ronny.h" |
yangzhenye | 3:30c81344beff | 8 | #include "Ball.h" |
yangzhenye | 3:30c81344beff | 9 | |
yangzhenye | 3:30c81344beff | 10 | class RonnyEngine{ |
yangzhenye | 3:30c81344beff | 11 | public: |
yangzhenye | 3:30c81344beff | 12 | RonnyEngine(); |
yangzhenye | 3:30c81344beff | 13 | ~RonnyEngine(); |
yangzhenye | 3:30c81344beff | 14 | void init(); |
yangzhenye | 3:30c81344beff | 15 | void reset(); |
yangzhenye | 3:30c81344beff | 16 | void check_reset(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 17 | void check_start(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 18 | void check_collision(Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 19 | void get_score(); |
yangzhenye | 3:30c81344beff | 20 | void get_sprite(); |
yangzhenye | 3:30c81344beff | 21 | void update_lcd(N5110 &lcd); |
yangzhenye | 3:30c81344beff | 22 | void run_engine(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 23 | bool get_reset_flag(); |
yangzhenye | 3:30c81344beff | 24 | bool get_start_flag(); |
yangzhenye | 3:30c81344beff | 25 | void get_ronny_x(Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 26 | private: |
yangzhenye | 3:30c81344beff | 27 | int _player_x; |
yangzhenye | 3:30c81344beff | 28 | int _player_y; |
yangzhenye | 3:30c81344beff | 29 | int _x; |
yangzhenye | 3:30c81344beff | 30 | int _y; |
yangzhenye | 3:30c81344beff | 31 | bool _collision_flag; |
yangzhenye | 3:30c81344beff | 32 | bool _start_flag; |
yangzhenye | 3:30c81344beff | 33 | bool _reset_flag; |
yangzhenye | 3:30c81344beff | 34 | int _speed; |
yangzhenye | 3:30c81344beff | 35 | int _player_score; |
yangzhenye | 3:30c81344beff | 36 | } |
yangzhenye | 3:30c81344beff | 37 | #endif |
yangzhenye | 3:30c81344beff | 38 |