
Final Commit
Dependencies: mbed
Snake/Snake.h
- Committer:
- JRM1986
- Date:
- 2018-04-09
- Revision:
- 12:9f2f64016f56
- Parent:
- 11:e260c17a0489
- Child:
- 13:72bc2579e85e
File content as of revision 12:9f2f64016f56:
#ifndef SNAKE_H #define SNAKE_H #include "mbed.h" #include "FXOS8700CQ.h" #include "Gamepad.h" #include "N5110.h" struct StateDirection { Direction output; Direction nextState[4]; }; Vector2D g_snake_position(); // global variable to increment/decrement the position of the snake static Vector2D g_p; Direction current_direction(); // global variable to hold the current direction static Direction g_d; /** Snake Class * @brief Describes the methods and functions for the snake * @author Joshua R. Marshall * @date Feb, 2018 */ class Snake { public: Snake(); // constructor ~Snake(); // destructor void init(); void update(Direction in, Direction cur); void draw(N5110 &lcd); void set_snake_direction(Direction input, Direction current); Direction get_snake_direction(); // void set_current_direction(Direction new_cur); Direction get_current_direction(); void set_snake_position(Direction next); Vector2D get_snake_position(); private: Direction _direction; Direction _next; int _x; int _y; }; #endif