Merge branch 'develop' of github.com:AnonymusRaccoon/Bomberman into parser

# Conflicts:
#	sources/Map/Map.cpp
#	sources/Runner/GameScene.cpp
#	sources/Runner/PauseMenuScene.cpp
#	sources/Runner/Runner.cpp
#	sources/System/Controllable/ControllableSystem.cpp
#	sources/System/Lobby/LobbySystem.cpp
This commit is contained in:
Clément Le Bihan
2021-06-19 14:39:43 +02:00
34 changed files with 219 additions and 165 deletions
+24 -27
View File
@@ -3,7 +3,6 @@
//
#include <Wal.hpp>
#include <iostream>
#include "System/Movable/MovableSystem.hpp"
#include "System/Renderer/RenderSystem.hpp"
#include <Drawables/2D/Rectangle.hpp>
@@ -12,15 +11,9 @@
#include "System/Controllable/ControllableSystem.hpp"
#include "System/Gamepad/GamepadSystem.hpp"
#include <System/Collision/CollisionSystem.hpp>
#include "Component/Button/ButtonComponent.hpp"
#include <Component/Collision/CollisionComponent.hpp>
#include <Component/Controllable/ControllableComponent.hpp>
#include <Component/IAControllable/IAControllableComponent.hpp>
#include <Component/Keyboard/KeyboardComponent.hpp>
#include <System/Gamepad/GamepadSystem.hpp>
#include "Component/Renderer/CameraComponent.hpp"
#include "Component/Renderer/Drawable3DComponent.hpp"
#include "Component/Renderer/Drawable2DComponent.hpp"
#include "Runner.hpp"
#include "Models/GameState.hpp"
#include <System/Timer/TimerSystem.hpp>
@@ -37,7 +30,6 @@
#include "System/Shaders/ShaderDrawable2DSystem.hpp"
#include "System/Shaders/ShaderModelSystem.hpp"
#include "System/Animation/AnimationsSystem.hpp"
#include "Map/Map.hpp"
#include "System/IAControllable/IAControllableSystem.hpp"
#include "System/MenuControllable/MenuControllableSystem.hpp"
#include <System/Bomb/BombSystem.hpp>
@@ -52,7 +44,6 @@
#include "System/Lobby/LobbySystem.hpp"
#include "System/Score/ScoreSystem.hpp"
#include "System/EndCondition/EndConditionSystem.hpp"
#include "Component/Lobby/LobbyComponent.hpp"
#include "System/Bonus/BonusUISystem.hpp"
namespace BBM
@@ -68,21 +59,27 @@ namespace BBM
engine.shouldClose = true;
if (gameState.currentScene == GameState::SceneID::GameScene) {
for (auto &[_, component]: engine.getScene()->view<ControllableComponent>()) {
component.fastClick = true;
if (component.pause && gameState.currentScene == GameState::SceneID::GameScene) {
gameState.nextScene = GameState::SceneID::PauseMenuScene;
break;
}
}
if (gameState.nextScene != GameState::SceneID::GameScene)
engine.getSystem<CameraSystem>().hasEnded = false;
}
if (gameState.nextScene == gameState.currentScene)
return;
if (gameState.nextScene == GameState::SceneID::ScoreScene)
gameState._loadedScenes[GameState::SceneID::ScoreScene] = Runner::loadScoreScene(*engine.getScene());
if (gameState.previousScene == GameState::SceneID::GameScene) {
for (auto &[_, component]: engine.getScene()->view<ControllableComponent>()) {
component.fastClick = false;
}
}
if (gameState.nextScene == GameState::SceneID::ScoreScene) {
gameState.loadedScenes[GameState::SceneID::ScoreScene] = Runner::loadScoreScene(*engine.getScene());
}
RAY::Window::getInstance().setVisibleCursor(gameState.nextScene != GameState::SceneID::GameScene);
gameState._loadedScenes[gameState.currentScene] = engine.getScene();
engine.changeScene(gameState._loadedScenes[gameState.nextScene]);
gameState.loadedScenes[gameState.currentScene] = engine.getScene();
engine.changeScene(gameState.loadedScenes[gameState.nextScene]);
gameState.previousScene = gameState.currentScene;
gameState.currentScene = gameState.nextScene;
}
@@ -113,10 +110,10 @@ namespace BBM
.addSystem<ShaderSystem>()
.addSystem<ShaderModelSystem>()
.addSystem<ShaderDrawable2DSystem>()
.addSystem<EndConditionSystem>()
.addSystem<ScoreSystem>()
.addSystem<CameraSystem>()
.addSystem<ResumeLobbySystem>()
.addSystem<EndConditionSystem>()
.addSystem<MusicSystem>();
}
@@ -153,15 +150,15 @@ namespace BBM
void Runner::loadScenes()
{
gameState._loadedScenes[GameState::SceneID::MainMenuScene] = loadMainMenuScene();
gameState._loadedScenes[GameState::SceneID::SettingsScene] = loadSettingsMenuScene();
gameState._loadedScenes[GameState::SceneID::PauseMenuScene] = loadPauseMenuScene();
gameState._loadedScenes[GameState::SceneID::TitleScreenScene] = loadTitleScreenScene();
gameState._loadedScenes[GameState::SceneID::CreditScene] = loadCreditScene();
gameState._loadedScenes[GameState::SceneID::SplashScreen] = loadSplashScreenScene();
gameState._loadedScenes[GameState::SceneID::LobbyScene] = loadLobbyScene();
gameState._loadedScenes[GameState::SceneID::ResumeLobbyScene] = loadResumeLobbyScene();
gameState._loadedScenes[GameState::SceneID::HowToPlayScene] = loadHowToPlayScene();
gameState.loadedScenes[GameState::SceneID::MainMenuScene] = loadMainMenuScene();
gameState.loadedScenes[GameState::SceneID::SettingsScene] = loadSettingsMenuScene();
gameState.loadedScenes[GameState::SceneID::PauseMenuScene] = loadPauseMenuScene();
gameState.loadedScenes[GameState::SceneID::TitleScreenScene] = loadTitleScreenScene();
gameState.loadedScenes[GameState::SceneID::CreditScene] = loadCreditScene();
gameState.loadedScenes[GameState::SceneID::SplashScreen] = loadSplashScreenScene();
gameState.loadedScenes[GameState::SceneID::LobbyScene] = loadLobbyScene();
gameState.loadedScenes[GameState::SceneID::ResumeLobbyScene] = loadResumeLobbyScene();
gameState.loadedScenes[GameState::SceneID::HowToPlayScene] = loadHowToPlayScene();
}
int Runner::run()
@@ -171,9 +168,9 @@ namespace BBM
Runner::addSystems(wal);
Runner::enableRaylib(wal);
Runner::loadScenes();
wal.changeScene(Runner::gameState._loadedScenes[GameState::SceneID::SplashScreen]);
wal.changeScene(Runner::gameState.loadedScenes[GameState::SceneID::SplashScreen]);
wal.run<GameState>(Runner::updateState, Runner::gameState);
gameState._loadedScenes.clear();
gameState.loadedScenes.clear();
return 0;
}
}