
Final Commit
Dependencies: mbed
Diff: SnakeEngine/SnakeEngine.h
- Revision:
- 6:f3f508cea1c4
- Parent:
- 3:50f01159c61d
- Child:
- 7:c38800a428a6
--- a/SnakeEngine/SnakeEngine.h Tue Mar 13 09:42:49 2018 +0000 +++ b/SnakeEngine/SnakeEngine.h Fri Mar 16 13:02:55 2018 +0000 @@ -5,6 +5,8 @@ #include "FXOS8700CQ.h" #include "Gamepad.h" #include "N5110.h" +#include "Food.h" +#include "Snake.h" /** SnakeEngine Class * @brief Class that initialises and defines the game charectoristics ready for the main file @@ -15,12 +17,30 @@ { public: + SnakeEngine(); // constructor ~SnakeEngine(); // destructor - + + void init(Vector2D food_position); // initiallises the position of the food, and snake + void draw(N5110 &lcd); // draws snake/food to the lcd + void update(Gamepad &pad); // updates depending on gamepad input + void get_input(Gamepad &pad); // gets the input from the gamepad + private: + void check_wall_reached(); // checks if snake has hit the side + void check_food_eaten(); // checks if snake has eaten the food + void check_tail_collision(); // checks if snake has collided with its own tail + + // ----- Food Position ----- + + int _fx; + int _fy; + + Food _food; + + Snake _snake; }; #endif \ No newline at end of file