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:
- 13:4fa0d5148216
- Parent:
- 12:cb3a81adf48b
- Child:
- 14:4356797fd16e
--- a/GameEngine/GameEngine.cpp Sun May 24 14:19:21 2020 +0000
+++ b/GameEngine/GameEngine.cpp Sun May 24 15:08:31 2020 +0000
@@ -13,8 +13,8 @@
void GameEngine::init(int head_size, int head_speed)
{
srand(time(NULL));
- _mouse_x = rand() %(WIDTH-4);
- _mouse_y = rand() %(HEIGHT-4);
+ _mouse_x = rand() %WIDTH+2;
+ _mouse_y = rand() %HEIGHT+2;
_game_over = false;
_score = 0;
_mouse = 0;
@@ -73,8 +73,8 @@
_mouse = 0;
pad.tone(750.0, 0.1);
srand(time(NULL));
- _mouse_x = rand() %WIDTH-4;
- _mouse_y = rand() %HEIGHT-4;
+ _mouse_x = rand() %WIDTH+2;
+ _mouse_y = rand() %HEIGHT+2;
_length++;
}
}