diff --git a/assets/buttons/button_htp.png b/assets/buttons/button_htp.png new file mode 100644 index 00000000..c54d0afd Binary files /dev/null and b/assets/buttons/button_htp.png differ diff --git a/assets/buttons/button_htp_hovered.png b/assets/buttons/button_htp_hovered.png new file mode 100644 index 00000000..227dcc7c Binary files /dev/null and b/assets/buttons/button_htp_hovered.png differ diff --git a/sources/Runner/LobbyScene.cpp b/sources/Runner/LobbyScene.cpp index 54e45191..3de21ab9 100644 --- a/sources/Runner/LobbyScene.cpp +++ b/sources/Runner/LobbyScene.cpp @@ -85,6 +85,25 @@ namespace BBM texture->use("assets/buttons/button_back_hovered.png"); }); + auto &howToPlay = scene->addEntity("to to play") + .addComponent(1920 - 10 - 75, 1080 - 85, 0) + .addComponent("assets/buttons/button_htp.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_htp.png"); + }) + .addComponent([](WAL::Entity &entity, WAL::Wal &) + { + RAY::Texture *texture = dynamic_cast(entity.getComponent().drawable.get()); + + texture->use("assets/buttons/button_htp_hovered.png"); + }); auto &lavaOption = scene->addEntity("lava option text") .addComponent(1920 / 6, 2 * 1080 / 3, 0) .addComponent("Lava: Off", 70, RAY::Vector2(), BLACK) @@ -148,7 +167,8 @@ namespace BBM scene->addEntity("camera") .addComponent(8, 20, 7) .addComponent(Vector3f(8, 0, 8)); - play.getComponent().setButtonLinks(&lavaOption, &back, &back, nullptr); + play.getComponent().setButtonLinks(&lavaOption, &back, &back, &howToPlay); + howToPlay.getComponent().setButtonLinks(&play, nullptr, &play); back.getComponent().setButtonLinks(&play, nullptr, nullptr, &play); lavaOption.getComponent().setButtonLinks(nullptr, &play, nullptr, &heightOption); heightOption.getComponent().setButtonLinks(nullptr, &play, &lavaOption, nullptr);