Final Submission. I have read and agreed with Statement of Academic Integrity.
Dependencies: mbed Gamepad N5110 Joystick
Diff: Game_engine/Game_engine.h
- Revision:
- 10:aedca0082855
- Parent:
- 9:a7ea33e6bd82
--- a/Game_engine/Game_engine.h Thu May 09 11:36:21 2019 +0000 +++ b/Game_engine/Game_engine.h Thu May 09 13:52:41 2019 +0000 @@ -9,23 +9,57 @@ #include "Snake.h" - +/** GameEngine Class + * @brief The game engine for snake game + * @author Daniel Crockford 201039580 + * @date 09 May 2019 + */ class GameEngine { public: + /** Constructor */ GameEngine(); + + /** DeConstructor */ ~GameEngine(); + + /** resets direction */ void direction_reset(); + + /** initialises engine */ void init(); + + /** draws all objects + * @param N5110 class for controlling lcd screen */ void draw(N5110 &lcd); + + /** get directions from gamepad + * param Gamepad class for accessing gamepad controls */ void get_dir(Gamepad &gamepad); + + /** moves snake */ void snake_move(); + + /** moves food */ void food_move(); + + /** draws snake body + * @param N5110 class for controlling lcd screen*/ void snake_body(N5110 &lcd); + + /** checks for collisions with wall and creates flag */ void check_wall_collision(); + + /** checks for collision with snake body and creates flag */ void check_snake_collision(); + + /** get game continue flag */ bool get_game_cont(); + + /** get direction value */ int get_direction(); + + /** get score */ int get_score(); private: