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: main.cpp
- Revision:
- 20:a359092079b0
- Parent:
- 19:5a7b0cdf013b
- Child:
- 21:6b16ca9834e6
--- a/main.cpp Thu Apr 25 08:43:46 2019 +0000 +++ b/main.cpp Thu Apr 25 11:34:01 2019 +0000 @@ -30,6 +30,7 @@ Gamepad pad; Engine eng; Doodler dood; +Enemy eny; // prototypes void init(); @@ -53,14 +54,19 @@ wait(0.8f/fps); if (pad.check_event(Gamepad::BACK_PRESSED) == true){ break; - } - if (dood.get_position_y() > 36){ + } + Vector2D eny_pos = eny.get_position(); + if ( + (dood.get_position_y() > 48) || + ((eny_pos.y < dood.get_position_y() < eny_pos.y + 6) && (eny_pos.x< dood.get_position_y()< eny_pos.x + 6)) + ){ while(1){ game_over(); if (pad.check_event(Gamepad::START_PRESSED) == true){ break; } } + break; } } render();