Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SnakeFood/SnakeFood.h
- Committer:
- AhmedPlaymaker
- Date:
- 2019-04-23
- Revision:
- 41:4edac50f010d
- Parent:
- 38:30e4e6191762
File content as of revision 41:4edac50f010d:
#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, int blockbuff);
/** 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);
Vector2D velocity;
private:
int n;
int _fx; //food x
int _fy; //food y
int _blockbuff;
};
#endif