zhenye yang
/
el17zy
Yang Zhenye 201199680
RooneyEngine/RooneyEngine.h@5:fcad75e9b9e1, 2020-05-14 (annotated)
- Committer:
- yangzhenye
- Date:
- Thu May 14 14:13:03 2020 +0000
- Revision:
- 5:fcad75e9b9e1
- Parent:
- 4:eb8dca1dc341
- Child:
- 7:a69ae964412c
first
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
yangzhenye | 5:fcad75e9b9e1 | 1 | #ifndef ROONEYENGINE_H |
yangzhenye | 5:fcad75e9b9e1 | 2 | #define ROONEYENGIN_H |
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 | 4:eb8dca1dc341 | 7 | #include "Rooney.h" |
yangzhenye | 3:30c81344beff | 8 | #include "Ball.h" |
yangzhenye | 3:30c81344beff | 9 | |
yangzhenye | 4:eb8dca1dc341 | 10 | class RooneyEngine{ |
yangzhenye | 3:30c81344beff | 11 | public: |
yangzhenye | 5:fcad75e9b9e1 | 12 | // Constructor and destructor. |
yangzhenye | 5:fcad75e9b9e1 | 13 | /** |
yangzhenye | 5:fcad75e9b9e1 | 14 | * @brief Constructor @details Non user specified. |
yangzhenye | 5:fcad75e9b9e1 | 15 | */ |
yangzhenye | 4:eb8dca1dc341 | 16 | RooneyEngine(); |
yangzhenye | 5:fcad75e9b9e1 | 17 | /** |
yangzhenye | 5:fcad75e9b9e1 | 18 | * @brief Destructor @details Non user specified. |
yangzhenye | 5:fcad75e9b9e1 | 19 | */ |
yangzhenye | 4:eb8dca1dc341 | 20 | ~RooneyEngine(); |
yangzhenye | 3:30c81344beff | 21 | void init(); |
yangzhenye | 3:30c81344beff | 22 | void reset(); |
yangzhenye | 3:30c81344beff | 23 | void check_reset(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 24 | void check_start(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 25 | void check_collision(Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 26 | void get_score(); |
yangzhenye | 3:30c81344beff | 27 | void get_sprite(); |
yangzhenye | 3:30c81344beff | 28 | void update_lcd(N5110 &lcd); |
yangzhenye | 3:30c81344beff | 29 | void run_engine(N5110 &lcd, Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 30 | bool get_reset_flag(); |
yangzhenye | 3:30c81344beff | 31 | bool get_start_flag(); |
yangzhenye | 4:eb8dca1dc341 | 32 | void get_ronney_x(Gamepad &gamepad); |
yangzhenye | 3:30c81344beff | 33 | private: |
yangzhenye | 3:30c81344beff | 34 | int _player_x; |
yangzhenye | 3:30c81344beff | 35 | int _player_y; |
yangzhenye | 3:30c81344beff | 36 | int _x; |
yangzhenye | 3:30c81344beff | 37 | int _y; |
yangzhenye | 3:30c81344beff | 38 | bool _collision_flag; |
yangzhenye | 3:30c81344beff | 39 | bool _start_flag; |
yangzhenye | 3:30c81344beff | 40 | bool _reset_flag; |
yangzhenye | 3:30c81344beff | 41 | int _speed; |
yangzhenye | 3:30c81344beff | 42 | int _player_score; |
yangzhenye | 5:fcad75e9b9e1 | 43 | }; |
yangzhenye | 3:30c81344beff | 44 | #endif |
yangzhenye | 3:30c81344beff | 45 |