ELEC2645 (2019/20)
/
ELEC2645_Project_el17oc1
Owen Cavender 201159294
snake.h
- Committer:
- el17oc
- Date:
- 2020-05-28
- Revision:
- 10:ee781d18e0f6
- Parent:
- 9:a69a6a06dddf
- Child:
- 11:e7c56013acd9
- Child:
- 12:60c856354406
File content as of revision 10:ee781d18e0f6:
#ifndef SNAKE_H #define SNAKE_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" class Snake { public: Snake(); ~Snake(); enum Directions { up, down, left, right, null }; void init(); void check_collisions(); void apple_collected(N5110 &lcd, Gamepad &pad, Timer &timer); void render_clear_tail(N5110 &lcd); void get_direction(Gamepad &pad); void move_snake(); void get_time(Timer &timer); void render(N5110 &lcd); void print_display_time(N5110 &lcd); bool get_gameover(); int get_oldscore(); int get_score(); Vector2D get_Snakehead(); private: void get_Apple_position(N5110 &lcd); bool _gameover; Directions _direction; int _oldscore; int _score; float _realtime; float _display_time; int Reset_value; int _x0; int _x1; int _x2; int _x3; int _y0; int _y1; int _y2; int _y3; int _apx; int _apy; //Vector2D SK0; //Vector2D SK1; //Vector2D SK2; //Vector2D SK3; }; #endif