else if (menu)
{
context.next_state = std::make_unique<Start_menu>(data);
- context.saved_game.release();
+ delete context.saved_game.release();
}
// changes color on text depending on selection
data{}
{
- data = std::move(params);
+ data = params;
sf::Texture main_enemy_texture;
sf::Texture sack_texture;
sf::Texture player_texture;
player->update(context);
helper->update(context);
+ enemy->update(context);
+ game_map->update(player->get_collected(), points, remaining_time);
+ if (yf != nullptr)
+ {
+ yf->update(context);
+ }
+ if(bike != nullptr)
+ {
+ bike->update(context);
+ }
// Handle collision
bike = std::make_unique<Bike_enemy>(bike_texture, data["bike_enemy"]);
time_since_last_bike = 0;
}
- enemy->update(context);
- game_map->update(player->get_collected(), points, remaining_time);
- if (yf != nullptr)
- {
- yf->update(context);
- }
- if(bike != nullptr)
- {
- bike->update(context);
- }
}
void Game_state::render(sf::RenderWindow &window) const