#include #include #include "Runner.hpp" #include #include "Component/Music/MusicComponent.hpp" #include "Component/Sound/SoundComponent.hpp" #include "Component/Controllable/ControllableComponent.hpp" #include "Component/Position/PositionComponent.hpp" #include "Component/Keyboard/KeyboardComponent.hpp" #include "Component/Renderer/Drawable2DComponent.hpp" #include "Component/Button/ButtonComponent.hpp" #include "Drawables/2D/Text.hpp" namespace RAY2D = RAY::Drawables::Drawables2D; namespace BBM { std::shared_ptr Runner::loadHowToPlayScene() { auto scene = std::make_shared(); static const std::map sounds = { {SoundComponent::BOMB, "assets/sounds/click.ogg"} }; addMenuControl(*scene, sounds); scene->addEntity("Control entity") .addComponent("assets/musics/music_player_select.ogg") .addComponent(sounds); scene->addEntity("background") .addComponent() .addComponent("assets/backgrounds/menu.png"); scene->addEntity("white background") .addComponent(200, 100, 0) .addComponent(Vector2f(), Vector2f(1525, 600), RAY::Color(WHITE).setA(150)); scene->addEntity("scene title text") .addComponent(1920 / 3, 100, 0) .addComponent("How To Play?", 120, RAY::Vector2(), ORANGE); scene->addEntity("select text") .addComponent(1920 / 8, 1080 / 3, 0) .addComponent("Select/Drop Bomb:", 60, RAY::Vector2(), ORANGE); scene->addEntity("select") .addComponent(1920 / 7, 1080 / 2.5, 0) .addComponent("Space/Left CTRL/A Button", 35, RAY::Vector2(), BLACK); scene->addEntity("change skin text") .addComponent(1920 / 8, 1080 / 2, 0) .addComponent("Change Skin:", 60, RAY::Vector2(), ORANGE); scene->addEntity("change skin") .addComponent(1920 / 7, 1080 / 1.75, 0) .addComponent("Left ctrl/Right shift/B Button", 35, RAY::Vector2(), BLACK); scene->addEntity("move text") .addComponent(1920 / 1.75, 1080 / 3, 0) .addComponent("Move:", 60, RAY::Vector2(), ORANGE); scene->addEntity("move") .addComponent(1920 / 1.75, 1080 / 2.5, 0) .addComponent("Q-Z-S-D/Arrow/Joystick", 35, RAY::Vector2(), BLACK); scene->addEntity("back text") .addComponent(1920 / 1.75, 1080 / 2, 0) .addComponent("Back/Pause:", 60, RAY::Vector2(), ORANGE); scene->addEntity("back") .addComponent(1920 / 1.75, 1080 / 1.75, 0) .addComponent("Esc/Backspace/Controller's Home button:", 35, RAY::Vector2(), BLACK); scene->addEntity("back to menu") .addComponent(10, 1080 - 85, 0) .addComponent("assets/buttons/button_back.png") .addComponent([](WAL::Entity &entity, WAL::Wal &) { gameState.nextScene = BBM::GameState::SceneID::LobbyScene; }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); texture->use("assets/buttons/button_back.png"); }) .addComponent([](WAL::Entity &entity, WAL::Wal &) { RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); texture->use("assets/buttons/button_back_hovered.png"); }); return scene; } }