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:
- 12:cb3a81adf48b
- Parent:
- 11:c4b740a970f8
- Child:
- 13:4fa0d5148216
diff -r c4b740a970f8 -r cb3a81adf48b GameEngine/GameEngine.cpp
--- a/GameEngine/GameEngine.cpp Sat May 23 10:50:43 2020 +0000
+++ b/GameEngine/GameEngine.cpp Sun May 24 14:19:21 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-4);
+ _mouse_y = rand() %(HEIGHT-4);
_game_over = false;
_score = 0;
_mouse = 0;
@@ -106,7 +106,7 @@
pad.tone(NOTE_C5, 0.1);
while(_game_over == true){
lcd.clear();
- lcd.printString(" GAME OVER! ", 5, 0);
+ lcd.printString(" GAME OVER! ", 0, 0);
char buffer[14];
sprintf(buffer, "%2d", _score);
lcd.printString(" You scored: ", 2, 2);