Commit ab75d8e9 authored by Miloslav Číž's avatar Miloslav Číž

Add game speedup

parent cef1e3b8
......@@ -51,6 +51,8 @@
#define B_DIRECTION_S 0b10000000
#define B_DIRECTION_W 0b11000000
#define GAME_SPEEDUP 5 ///< How many times the game can be sped up.
#define MAX_SEGMENTS 10 ///< Max number of segments per creep path.
#define MAX_PATHS 2 ///< Max number of paths per game map.
......@@ -2717,7 +2719,16 @@ void loop()
arduboy.pollButtons();
handleInputs();
game.update();
uint8_t updates =
(game.mState == STATE_PLAYING_WAVE && arduboy.pressed(B_BUTTON) &&
arduboy.pressed(UP_BUTTON)) ?
GAME_SPEEDUP :
1;
for (uint8_t i = 0; i < updates; ++i)
game.update();
arduboy.clear();
if (game.mState == STATE_MENU)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment