Game_state::Game_state() :
game_map{},
pause_game{false},
- gameover{false},
player{},
bottles{},
helper{},
int remaining_time {static_cast<int>(data["game_constants"]["game_time"]) - static_cast<int>(game_time)};
if (remaining_time < 0)
{
- context.next_state = std::make_unique<Start_menu>();
+ context.next_state = std::make_unique<GameOver_menu>();
return;
}
bike->update(context);
}
- if (gameover)
- {
- context.next_state = std::make_unique<GameOver_menu>();
- gameover = false;
- return;
- }
-
}
void Game_state::render(sf::RenderWindow &window) const
pause_game = true;
return;
break;
-
- case sf::Keyboard::T:
- gameover = true;
- break;
-
default:
break;
}