![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
SnakevsBlock/SnakevsBlock.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-03-27
- Revision:
- 9:d1d79d4ee673
- Parent:
- 7:48ba87cd79b5
- Child:
- 10:751bd953fa27
File content as of revision 9:d1d79d4ee673:
#ifndef SNAKEVSBLOCK_H #define SNAKEVSBLOCK_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Snake.h" #include "SnakeFood.h" class SnakevsBlock { public: SnakevsBlock(); ~SnakevsBlock(); /** Initialise Game Machine * * This function initialises the game machine. */ void init( ); /** Read Input * * This function obtains numeric data from the gamepads joystick. */ void read_input(Gamepad &pad); /** Update * * This function contains the update functions of the other libraries used in the game. */ void update(Gamepad &pad); /** Draw * * This function contains the draw functions of the other libraries used in the game. */ void draw(N5110 &lcd, Gamepad &pad); /** Get Position * * This function contains the Get Position functions of the otehr libraries used in the game. */ void get_pos(); int snakex; int snakey; int length; int foodbuff; //this makes food 1,2,and 3 come at seperate times private: Snake _s; SnakeFood _f; SnakeFood _ff; SnakeFood _fff; int _speed; Direction _d; float _mag; int n; /** Check for Snake and Food collision * * This function checks if the Snake has come into contact with it's food. */ void CheckSnakeFoodCollision(Gamepad &pad); }; #endif