NerfUS game coordinator for the Nerf gun firing range
Dependencies: HardwareInterface mbed-rtos mbed
Fork of NerfUS by
Diff: source/PlayableGame.cpp
- Branch:
- PlayableGame
- Revision:
- 19:33e8cd56630f
- Parent:
- 18:469c8b2a9af9
--- 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);