end condition: change scene only if scene has a player

This commit is contained in:
arthur.jamet
2021-06-15 11:28:24 +02:00
parent 2ec012c567
commit 005ddecf53
4 changed files with 12 additions and 3 deletions
+4
View File
@@ -34,6 +34,7 @@
#include "System/BumperTimer/BumperTimerSystem.hpp"
#include "System/Music/MusicSystem.hpp"
#include "System/Lobby/LobbySystem.hpp"
#include "System/EndCondition/EndConditionSystem.hpp"
#include "Component/Lobby/LobbyComponent.hpp"
namespace BBM
@@ -58,6 +59,8 @@ namespace BBM
}
if (gameState.nextScene == gameState.currentScene)
return;
if (gameState.nextScene == GameState::SceneID::ScoreScene)
gameState._loadedScenes[GameState::SceneID::ScoreScene] = Runner::loadScoreScene(*engine.getScene());
gameState._loadedScenes[gameState.currentScene] = engine.getScene();
engine.changeScene(gameState._loadedScenes[gameState.nextScene]);
gameState.currentScene = gameState.nextScene;
@@ -84,6 +87,7 @@ namespace BBM
.addSystem<IntroAnimationSystem>()
.addSystem<GravitySystem>()
.addSystem<BumperTimerSystem>()
.addSystem<EndConditionSystem>()
.addSystem<MusicSystem>();
}