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: Fruit/Fruit.cpp
- Revision:
- 13:4026781772cb
- Parent:
- 0:d557f30e3a95
- Child:
- 15:47ea86f1ed70
diff -r d45bc5d878ad -r 4026781772cb Fruit/Fruit.cpp
--- a/Fruit/Fruit.cpp Fri May 04 13:25:18 2018 +0000
+++ b/Fruit/Fruit.cpp Sun May 06 12:44:41 2018 +0000
@@ -22,8 +22,8 @@
void Fruit::reborn(){//randomise the location of the fruit after it is ate by the sanke
srand(time(NULL));
- _posx = rand() % 80;
- _posy = rand() % 40;
+ _posx = rand() % (WIDTH-5)+10;
+ _posy = rand() % (HEIGHT-10)+5;
}