Dependencies: mbed
Diff: SnakeEngine/SnakeEngine.h
- Revision:
- 13:72bc2579e85e
- Parent:
- 10:62d8cb7742c3
- Child:
- 14:c3a435597196
--- a/SnakeEngine/SnakeEngine.h Mon Apr 09 10:16:58 2018 +0000 +++ b/SnakeEngine/SnakeEngine.h Wed Apr 11 11:42:16 2018 +0000 @@ -8,6 +8,10 @@ #include "Food.h" #include "Snake.h" +#define SNAKE_X 74 +#define SNAKE_Y 23 +#define SNAKE_DIRECTION W + /** SnakeEngine Class * @brief Class that initialises and defines the game charectoristics ready for the main file * @author Joshua R. Marshall @@ -21,10 +25,10 @@ SnakeEngine(); // constructor ~SnakeEngine(); // destructor - void init(); // initiallises the position of the food, and snake + void init(Direction snake_current_direction, int snake_position_x, int snake_postion_y); // 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, Snake &snake); // gets the input from the gamepad + void get_input(Gamepad &pad); // gets the input from the gamepad private: @@ -42,7 +46,11 @@ Snake _snake; - Direction _next; + Direction _snake_current_direction; + int _snake_position_x; + int _snake_position_y; + + Direction _in; Direction _cur;