Commit ad970545 authored by Justine Martin's avatar Justine Martin 💖
Browse files

feat : Ecran de fin de jeu

parent e96aae2d
Loading
Loading
Loading
Loading
+16 −0
Changes for include/GlApplication.hpp: 16 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -22,6 +22,11 @@
#include "model/Player.hpp"
#include "model/Spaceship.hpp"

#define WIN_NOT_WIN_YET -1
#define WIN_PLAYER_1 1
#define WIN_PLAYER_2 2
#define WIN_DRAW 3

class RenderObject;

class GlApplication : public Application {
@@ -51,9 +56,13 @@ class GlApplication : public Application {
        void createEntities();

        void renderFrame() override;
        void renderGameFrame();
        void renderGameEndedFrame();
        void renderGUI();

        void update() override;
        void updateGame();
        void updateGameEnded();
        static void resize(GLFWwindow * window, int framebufferWidth, int framebufferHeight);
        static void keyCallback(GLFWwindow * window, int key, int scancode, int action, int mods);
        void continuousKey(float deltaTime);
@@ -61,6 +70,8 @@ class GlApplication : public Application {

        void processPlayer1Input(GLFWwindow *window, float deltaTime);
        void processPlayer2Input(GLFWwindow *window, float deltaTime);

        void resetGame();
    private:
        bool drawBoundingBoxes;

@@ -81,6 +92,11 @@ class GlApplication : public Application {
        std::shared_ptr<Spaceship> m_spaceshipPlayer1;        ///< Player 1 spaceship
        std::shared_ptr<Spaceship> m_spaceshipPlayer2;        ///< Player 2 spaceship

        std::shared_ptr<GuiElement> win;
        std::shared_ptr<GuiElement> lose;
        std::shared_ptr<GuiElement> draw;

        int winner;

        Program guiProgram;
};
+1 −1
Changes for include/GuiElement.hpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@ class GuiElement {

	public: 

		GuiElement(Program &program);
		GuiElement(Program &program, const std::string &texturePath);

		void setPosition(glm::vec2 position);
		void setDimension(glm::vec2 dimension);

meshes/draw.png

0 → 100644
+32.9 KiB
Loading image diff...

meshes/lose.png

0 → 100644
+36.8 KiB
Loading image diff...

meshes/lose.xcf

0 → 100644
+79.1 KiB

File added.

No diff preview for this file type.

Loading