r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
rtypeClientSolo.cpp
Go to the documentation of this file.
5
6void gme::RTypeClientSolo::setupScenes(bool &showDebug, eng::id menuSceneId)
7{
8 auto configSoloId = m_engine->getSceneManager()->generateNextId();
9 auto configSolo = std::make_unique<ConfigSolo>(configSoloId, m_engine->getRenderer());
10 configSolo->addSystem(std::make_unique<ecs::AudioSystem>(m_engine->getAudio(), m_appConfig->audioVolume,
11 configSolo->getRegistry(), configSolo->playMusic()));
12 configSolo->addSystem(std::make_unique<ecs::DebugSystem>(m_engine->getRenderer(), showDebug));
13 configSolo->addSystem(std::make_unique<ecs::SpriteSystem>(m_engine->getRenderer()));
14 configSolo->addSystem(std::make_unique<ecs::TextSystem>(m_engine->getRenderer()));
15 configSolo->addSystem(std::make_unique<ecs::StarfieldSystem>(m_engine->getRenderer(), configSolo->getRegistry()));
16 auto gameSoloId = m_engine->getSceneManager()->generateNextId();
17 auto gameSolo = std::make_unique<GameSolo>(gameSoloId, m_engine->getRenderer(), m_engine->getAudio(),
18 m_appConfig->skinIndex, showDebug);
19 gameSolo->addSystem(std::make_unique<ecs::AudioSystem>(m_engine->getAudio(), m_appConfig->audioVolume,
20 gameSolo->getRegistry(), gameSolo->playMusic()));
21 gameSolo->addSystem(std::make_unique<ecs::SpriteSystem>(m_engine->getRenderer()));
22 gameSolo->addSystem(std::make_unique<ecs::TextSystem>(m_engine->getRenderer()));
23 gameSolo->addSystem(std::make_unique<ecs::AnimationSystem>(m_engine->getRenderer()));
24 gameSolo->addSystem(std::make_unique<ecs::BeamSystem>(m_engine->getRenderer()));
25 gameSolo->addSystem(std::make_unique<CollisionSystem>(m_engine->getRenderer(), showDebug));
26 gameSolo->addSystem(std::make_unique<EnemySystem>(m_engine->getRenderer()));
27 gameSolo->addSystem(std::make_unique<ExplosionSystem>(m_engine->getRenderer()));
28 gameSolo->addSystem(std::make_unique<LoadingAnimationSystem>(m_engine->getRenderer()));
29 gameSolo->addSystem(std::make_unique<PlayerDirectionSystem>(m_appConfig->skinIndex));
30 gameSolo->addSystem(std::make_unique<ProjectileSystem>(m_engine->getRenderer()));
31 gameSolo->addSystem(std::make_unique<ScrollingSystem>(m_engine->getRenderer()));
32 gameSolo->addSystem(std::make_unique<WeaponSystem>(m_engine->getRenderer()));
33 gameSolo->addSystem(std::make_unique<SpawnSystem>(m_engine->getRenderer()));
34 gameSolo->addSystem(std::make_unique<ecs::DebugSystem>(m_engine->getRenderer(), showDebug));
35 gameSolo->addSystem(std::make_unique<HUDSystem>(m_engine->getRenderer(), gameSolo->getRegistry()));
36 gameSolo->addSystem(std::make_unique<ecs::StarfieldSystem>(m_engine->getRenderer(), gameSolo->getRegistry()));
37 m_mainSceneId = configSoloId;
38
39 configSolo->onOptionSelected = [this, gameSoloId, menuSceneId](const std::string &option)
40 {
41 if (option == "Level easy")
42 {
43 m_engine->getSceneManager()->switchToScene(gameSoloId);
44 }
45 else if (option == "Level medium")
46 {
47 m_engine->getSceneManager()->switchToScene(gameSoloId);
48 }
49 else if (option == "Go back to menu")
50 {
51 m_engine->getSceneManager()->switchToScene(menuSceneId);
52 }
53 };
54
55 m_engine->getSceneManager()->addScene(std::move(configSolo));
56 m_engine->getSceneManager()->addScene(std::move(gameSolo));
57}
58
59void gme::RTypeClientSolo::update(float deltaTime, unsigned int width, unsigned int height) {}
This file contains the solo configuration scene.
This file contains the solo Game scene.
This file contains the RTypeClientSolo class declaration.
std::shared_ptr< IAudio > & getAudio()
Definition Engine.hpp:47
std::shared_ptr< IRenderer > & getRenderer()
Definition Engine.hpp:49
std::unique_ptr< SceneManager > & getSceneManager()
Definition Engine.hpp:51
utl::cli::AppConfig * m_appConfig
void update(float deltaTime, unsigned int width, unsigned int height) override
void setupScenes(bool &showDebug, eng::id menuSceneId)
unsigned int id
Definition IScene.hpp:20
This file contains the system definitions.