1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

FlappyBug: Add an input cooldown after game over

This makes sure the player doesn't accidentally start a new game after
they bump into an obstacle.
This commit is contained in:
Mim Hufford 2021-06-02 10:37:00 +01:00 committed by Linus Groh
parent 018344bb07
commit f50003bdd2
2 changed files with 26 additions and 3 deletions

View file

@ -34,6 +34,7 @@ private:
void tick();
void reset();
void game_over();
bool ready_to_start() const;
struct Bug {
const float x { 50 };
@ -99,6 +100,7 @@ private:
Optional<float> m_highscore;
float m_last_score;
float m_difficulty;
float m_restart_cooldown;
};
}