![](/media/cache/profiles/LinkedIn_0NghoZJ.jpeg.50x50_q85.jpg)
Snake vs Block Game to be run upon K64F.
SnakeFood/SnakeFood.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-03-27
- Revision:
- 9:d1d79d4ee673
- Child:
- 25:e827f1a8fadc
File content as of revision 9:d1d79d4ee673:
#ifndef SNAKEFOOD_H #define SNAKEFOOD_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" class SnakeFood { public: SnakeFood(); ~SnakeFood(); /** Initialise SnakeFood * * This function initialises the SnakeFood library. */ void init(); /** Draw * * This function draws the SnakeFood sprite onto the screen. */ void draw(N5110 &lcd); /** Update * * This function updates the position of the SnakeFood as it moves down the screen. */ void update(); /** Get Position * * This function obtains the coordinates of the top-left pixel in the SnakeFood sprite. */ Vector2D get_pos(); /** Set Position * * This function is used to change the position of the sprite to specific coordinates when called. */ void set_pos(Vector2D p); private: int n; int _fx; //food x int _fy; //food y int fooddrop; //this makes food 1,2,and 3 drop at reasonable speeds Vector2D _velocity; }; #endif