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:
- 14:cf4a32245152
- Parent:
- 12:4d7f1349d796
- Child:
- 15:658f1216ee84
--- a/GameEngine/GameEngine.cpp Fri May 04 23:26:17 2018 +0000
+++ b/GameEngine/GameEngine.cpp Sun May 06 16:17:41 2018 +0000
@@ -18,7 +18,7 @@
_asteroid1.init(2);
_asteroid2.init(3);
_asteroid3.init(4);
-
+ time.reset();
gameOver=0;
}
@@ -81,6 +81,8 @@
pad.leds_on(); //LEDs flashing
wait(0.5);
pad.leds_off();
+ //debugging
+ printf("((collision occurs))\n" );
}
}
}
@@ -103,6 +105,8 @@
pad.leds_on(); //LEDs flashing
wait(0.5);
pad.leds_off();
+ //debugging
+ printf("((collision occurs))\n");
}
}
}
@@ -125,6 +129,8 @@
pad.leds_on(); //LEDs flashing
wait(0.5);
pad.leds_off();
+ //debugging
+ printf("((collision occurs))\n");
}
}
}
@@ -158,7 +164,12 @@
time.stop ();
return gameOver;
}
-
+void GameEngine::reset_gameOver(){
+
+ //rest time and game over value to play again
+ time.reset();
+ gameOver=0;
+}
void GameEngine::time_increment()
{