![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
Owen Cavender 201159294
Dependencies: mbed
snake.h
- Committer:
- el17oc
- Date:
- 2020-05-26
- Revision:
- 1:897160a1a3ae
- Child:
- 2:ffbfd3f53ee2
File content as of revision 1:897160a1a3ae:
#ifndef SNAKE_H #define SNAKE_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "GameEngine.h" class Snake { public: Snake(); ~Snake(); enum Directions { up, down, left, right, null }; void init(); int set_direction(Gamepad &pad); //Directions get_direction(); void move_and_draw_snake(N5110 &lcd); void gameover_true(N5110 &lcd); void check_if_scored(N5110 &lcd, Gamepad &pad); void check_wall_collisions(); // void render(N5110 &lcd); void clear_applepos(N5110 &lcd); private: bool _gameover; Directions _direction; int _length; int _score; GameEngine _engine; }; #endif