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: Frogger/Frogger.cpp
- Revision:
- 49:6cad8b6ec5f2
- Parent:
- 48:8ccfc74b60a5
- Child:
- 50:9ffeb4a10c0a
--- a/Frogger/Frogger.cpp Sat May 23 21:47:19 2020 +0000 +++ b/Frogger/Frogger.cpp Sun May 24 02:30:49 2020 +0000 @@ -93,9 +93,11 @@ //keep reading and processing user input while(1) { graphics.clear(); // clear the lcd screen + + graphics.drawDangerZone(); + graphics.drawSafetyLanes(); + graphics.drawEndPost(); process_input(); // user controls the frog object - - graphics.drawSafetyLanes(); if(frog->y >= water_level) { @@ -110,7 +112,7 @@ graphics.print(); } } - + graphics.showFrog(frog->x, frog->y, frog->width, frog->height, state_frog); // display current position of frog graphics.refresh(); // refresh the lcd screen @@ -272,10 +274,10 @@ void Frogger::checkOutOfBounds(Object *obj) { if(obj->object.x > 84 + randCars()){ - obj->object.x = -4; + obj->object.x = -2; - } else if(obj->object.x < (-4)) { - obj->object.x = 84 + 4; + } else if(obj->object.x < -8) { + obj->object.x = 84; } }