diff --git a/assets/win.png b/assets/win.png new file mode 100644 index 0000000..0931f53 Binary files /dev/null and b/assets/win.png differ diff --git a/src/gui/src/render/core/Core.cpp b/src/gui/src/render/core/Core.cpp index cac4fc2..11fe270 100644 --- a/src/gui/src/render/core/Core.cpp +++ b/src/gui/src/render/core/Core.cpp @@ -4,6 +4,7 @@ #include "../scenes/Home.hpp" #include "../scenes/Quit.hpp" #include "../scenes/Menu.hpp" +#include "../scenes/WinScene.hpp" #include #include "../../utils/GuiException.hpp" @@ -22,6 +23,7 @@ Core::Core(int port, std::string ip) { _scenes[GameState::END] = std::make_shared(this); _scenes[GameState::GAME] = std::make_shared(this); _scenes[GameState::MENU] = std::make_shared(this); + _scenes[GameState::WIN] = std::make_shared(this); _clock.restart(); initSounds(); _sounds["music"].play(); diff --git a/src/gui/src/render/core/Core.hpp b/src/gui/src/render/core/Core.hpp index cbe230e..410d29b 100644 --- a/src/gui/src/render/core/Core.hpp +++ b/src/gui/src/render/core/Core.hpp @@ -25,6 +25,7 @@ enum GameState { GAME, QUIT, END, + WIN, DEFAULT, }; class Core { @@ -59,6 +60,7 @@ class Core { int _tickRate = 2; bool _funMode = false; + std::string _winner = ""; private: sf::RenderWindow _window; sf::Event _event; diff --git a/src/gui/src/render/scenes/WinScene.cpp b/src/gui/src/render/scenes/WinScene.cpp new file mode 100644 index 0000000..791094d --- /dev/null +++ b/src/gui/src/render/scenes/WinScene.cpp @@ -0,0 +1,45 @@ +/* +** EPITECH PROJECT, 2024 +** zappy +** File description: +** WinScene +*/ + +#include "WinScene.hpp" +#include "../core/Core.hpp" + +WinScene::WinScene(Core *core) +{ + _text.setFont(core->getFont()); + _text.setCharacterSize(25); + _text.setFillColor(sf::Color::White); + _core = core; + _quitButton = std::make_shared