Yang Zhenye 201199680
Dependencies: mbed
RooneyEngine/RooneyEngine.h@7:a69ae964412c, 2020-05-14 (annotated)
- Committer:
- yangzhenye
- Date:
- Thu May 14 17:19:27 2020 +0000
- Revision:
- 7:a69ae964412c
- Parent:
- 5:fcad75e9b9e1
- Child:
- 8:c02c278320c0
el17zy
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 | 7:a69ae964412c | 32 | void get_rooney_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 |