#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::loadCreditScene() { auto scene = std::make_shared(); static const std::map sounds = { {SoundComponent::JUMP, "assets/sounds/click.ogg"} }; addMenuControl(*scene); scene->addEntity("background") .addComponent() .addComponent("assets/plain_menu_background.png"); scene->addEntity("Control entity") .addComponent("assets/musics/music_title.ogg") .addComponent(sounds); auto &raylibLogo = scene->addEntity("raylib logo") .addComponent(1920 / 4, 1080 / 1.75, 0) .addComponent("assets/raylib.png"); auto &raylibText = scene->addEntity("raylib text") .addComponent(1920 / 4, 1080 / 2, 0) .addComponent("Powered by:", 35, RAY::Vector2(), BLACK); auto &otherRepoText = scene->addEntity("other repo text") .addComponent(1920 / 4, 1080 / 4, 0) .addComponent("Many Thanks to:", 35, RAY::Vector2(), BLACK); auto &BriansRepo = scene->addEntity("thx brian") .addComponent(1920 / 3.5, 1080 / 3.5, 0) .addComponent("Brian Guitteny (and his team)", 35, RAY::Vector2(), BLACK); auto &team = scene->addEntity("team") .addComponent(1920 / 1.5, 1080 / 3.5, 0) .addComponent("Team:\n Zoe Roux\n Clément Le Bihan\n Arthur Jamet\n Louis Auzuret\n Benjamin Henry\n Tom Augier", 35, RAY::Vector2(), BLACK); auto &back = 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::MainMenuScene; }) .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; } }