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.
Dependencies: mbed
Diff: SnakeEngine/SnakeEngine.h
- Revision:
- 13:c20acb3b1adf
- Parent:
- 12:8eb40a18f15d
- Child:
- 16:8cb23849b95a
diff -r 8eb40a18f15d -r c20acb3b1adf SnakeEngine/SnakeEngine.h
--- a/SnakeEngine/SnakeEngine.h Fri Jun 05 20:47:43 2020 +0000
+++ b/SnakeEngine/SnakeEngine.h Fri Jun 05 22:13:33 2020 +0000
@@ -24,11 +24,12 @@
SnakeEngine();
~SnakeEngine();
- void init(int apple_size, int snake_speed, int snake_score);
+ void init(int apple_size, int snake_speed, int snake_score, int snake_snakeheight, int snake_snakewidth);
void read_input(Gamepad &pad); //Allows us to read the input from the thumbstick
void update(Gamepad &pad, N5110 &lcd); //Allows us to update the gamepad
void draw(N5110 &lcd); //Allows us to draw on the screen
void dead(N5110 &lcd, Gamepad &pad); // The snake is DEAD :(
+ void eat(N5110 &lcd, Gamepad &pad); // Deals with the snake eating the apple
private:
void print_score(N5110 &lcd);
@@ -40,6 +41,8 @@
int _apple_size; //Apple size is defined and taken from main.cpp
int _snake_speed; //Stores the speed the snake goes
int _snake_score; //Stores the score
+ int _snake_snakeheight; // Snake Hight
+ int _snake_snakewidth; // Snake Width
bool _dead;
Snake _s; //Allows us to use the Snake