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: GameEngine/GameEngine.cpp
- Revision:
- 8:1e4182ebb063
- Parent:
- 7:c67a5c6a874f
- Child:
- 9:f0213e632379
--- a/GameEngine/GameEngine.cpp Thu May 21 13:55:57 2020 +0000
+++ b/GameEngine/GameEngine.cpp Thu May 21 14:16:51 2020 +0000
@@ -13,6 +13,7 @@
void GameEngine::init(int head_size, int head_speed)
{
_score = 0;
+ _mouse = 0;
_head_size = head_size;
_head_speed = head_speed;
@@ -72,10 +73,10 @@
int headX = headPos.x;
int headY = headPos.y;
- if (headX < 0 || headX > WIDTH) {
+ if (headX < 0+2 || headX > WIDTH-3) {
game_over(lcd, pad);
}
- if (headY < 0 || headY > HEIGHT) {
+ if (headY < 0+2 || headY > HEIGHT-3) {
game_over(lcd, pad);
}
}