Coordinator v2
Dependencies: NerfUSXbee PinDetect EthernetInterface JSON MFRC522 WebSocketClient mbed-rtos mbed
includes/GameModes/SpeedMode.hpp@1:e1c5259b7d9a, 2017-04-10 (annotated)
- Committer:
- Ismael Balafrej
- Date:
- Mon Apr 10 15:02:24 2017 -0400
- Revision:
- 1:e1c5259b7d9a
V1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Ismael Balafrej |
1:e1c5259b7d9a | 1 | #pragma once |
Ismael Balafrej |
1:e1c5259b7d9a | 2 | #include "GameMode.hpp" |
Ismael Balafrej |
1:e1c5259b7d9a | 3 | |
Ismael Balafrej |
1:e1c5259b7d9a | 4 | class SpeedMode : public GameMode |
Ismael Balafrej |
1:e1c5259b7d9a | 5 | { |
Ismael Balafrej |
1:e1c5259b7d9a | 6 | public: |
Ismael Balafrej |
1:e1c5259b7d9a | 7 | using GameMode::GameMode; |
Ismael Balafrej |
1:e1c5259b7d9a | 8 | Target* GetNextTarget() |
Ismael Balafrej |
1:e1c5259b7d9a | 9 | { |
Ismael Balafrej |
1:e1c5259b7d9a | 10 | return GetRandomTarget(); |
Ismael Balafrej |
1:e1c5259b7d9a | 11 | } |
Ismael Balafrej |
1:e1c5259b7d9a | 12 | void OnTargetHit(int timeTaken) |
Ismael Balafrej |
1:e1c5259b7d9a | 13 | { |
Ismael Balafrej |
1:e1c5259b7d9a | 14 | stats.targets++; |
Ismael Balafrej |
1:e1c5259b7d9a | 15 | stats.score += 5; |
Ismael Balafrej |
1:e1c5259b7d9a | 16 | } |
Ismael Balafrej |
1:e1c5259b7d9a | 17 | void OnTargetMiss() |
Ismael Balafrej |
1:e1c5259b7d9a | 18 | { |
Ismael Balafrej |
1:e1c5259b7d9a | 19 | stats.score -= 1; |
Ismael Balafrej |
1:e1c5259b7d9a | 20 | } |
Ismael Balafrej |
1:e1c5259b7d9a | 21 | int getTimeBetweenTargets() |
Ismael Balafrej |
1:e1c5259b7d9a | 22 | { |
Ismael Balafrej |
1:e1c5259b7d9a | 23 | return 1000; |
Ismael Balafrej |
1:e1c5259b7d9a | 24 | } |
Ismael Balafrej |
1:e1c5259b7d9a | 25 | }; |