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:
- 56:2797166656e0
- Parent:
- 55:b17b9931c010
- Child:
- 61:3714af9caab6
--- a/Frogger/Frogger.cpp Tue May 26 19:54:05 2020 +0000 +++ b/Frogger/Frogger.cpp Tue May 26 20:51:56 2020 +0000 @@ -134,6 +134,24 @@ } } +void Frogger::displayIntro() +{ + graphics.introOne(); + wait_ms(10); + graphics.refresh(); // refresh the lcd screen + + graphics.refresh(); // refresh the lcd screen + graphics.clear(); + graphics.introTwo(); + wait_ms(3000); + graphics.refresh(); // refresh the lcd screen + + graphics.refresh(); // refresh the lcd screen + graphics.clear(); + wait_ms(5000); + graphics.refresh(); // refresh the lcd screen +} + void Frogger::displayLevelIntro() { graphics.clear(); @@ -187,12 +205,22 @@ process_input(); // user controls the frog object actOnFrogBonus(); + + checkFrogInDeathZone(); graphics.showFrog(frog->x, frog->y, frog->width, frog->height, state_frog); // display current position of frog graphics.drawVoidBackGround(); } +void Frogger::checkFrogInDeathZone() +{ + if(frog->x < 35 || frog->x > 55) + { + frog->reset(); + } +} + void Frogger::checkProgression() { if((frog->y == 48 - 4*11 || frog->y == 48 - 4*10)){