NerfUS game coordinator for the Nerf gun firing range

Dependencies:   HardwareInterface mbed-rtos mbed

Fork of NerfUS by NerfUS

Branch:
PlayableGame
Revision:
19:33e8cd56630f
Parent:
18:469c8b2a9af9
diff -r 469c8b2a9af9 -r 33e8cd56630f source/PlayableGame.cpp
--- a/source/PlayableGame.cpp	Mon Mar 27 11:15:50 2017 -0400
+++ b/source/PlayableGame.cpp	Thu Mar 30 13:40:36 2017 -0400
@@ -26,6 +26,22 @@
     return points;
 }
 
+void PlayableGame::Start()
+{
+    iteration_timer.start(getTargetSpeed);
+}
+
+void PlayableGame::Stop()
+{
+    iteration_timer.stop();
+}
+
+void PlayableGame::TimerDoIteration()
+{
+    TargetInfo * nextTarget = GetNextTarget();
+    nextTarget->riseTarget();
+}
+
 GameStats PlayableGame::GetStats()
 {
     stats.accuracy = stats.numberOfHits * 10000 / (stats.numberOfHits + stats.numberOfMiss);