This repository has been archived by the owner on Jan 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refacto: Replaced game state by game current menu * ThePURGE class cleanup * Re-implemented old menus Co-authored-by: yanis fourel <yanis.fourel@epitech.eu>
- Loading branch information
1 parent
b049c7e
commit 47dad95
Showing
25 changed files
with
722 additions
and
732 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#pragma once | ||
|
||
#include <glm/vec2.hpp> | ||
#include <entt/entt.hpp> | ||
|
||
#include <Engine/Event/Event.hpp> | ||
|
||
namespace game { | ||
|
||
class ThePURGE; | ||
|
||
class AMenu { | ||
|
||
public: | ||
AMenu(); | ||
|
||
void onEvent(entt::registry &world, ThePURGE &game, const engine::Event &e); | ||
void onDraw(entt::registry &world, ThePURGE &game); | ||
|
||
protected: | ||
virtual void event(entt::registry &, ThePURGE &, const engine::Event &) {}; | ||
virtual void draw(entt::registry &, ThePURGE &) {}; | ||
|
||
bool up() const noexcept { return m_up; } | ||
bool down() const noexcept { return m_down; } | ||
bool right() const noexcept { return m_right; } | ||
bool left() const noexcept { return m_left; } | ||
|
||
private: | ||
static constexpr float kRecoveryThreshold = 0.4f; | ||
static constexpr float kTriggerThreshold = 0.6f; | ||
|
||
glm::vec2 m_prevLeftJoystick; | ||
|
||
bool m_up = false; | ||
bool m_down = false; | ||
bool m_left = false; | ||
bool m_right = false; | ||
|
||
|
||
bool m_recoveringUp = false; | ||
bool m_recoveringDown = false; | ||
bool m_recoveringRight = false; | ||
bool m_recoveringLeft = false; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#pragma once | ||
|
||
#include <entt/entt.hpp> | ||
|
||
#include "AMenu.hpp" | ||
|
||
namespace game::menu { | ||
|
||
class GameOver : public AMenu { | ||
public: | ||
void draw(entt::registry &world, ThePURGE &game) override; | ||
void event(entt::registry &world, ThePURGE &game, const engine::Event &e) override; | ||
|
||
}; | ||
|
||
} // namespace game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <entt/entt.hpp> | ||
|
||
#include "AMenu.hpp" | ||
|
||
namespace game::menu { | ||
|
||
class MainMenu : public AMenu { | ||
public: | ||
void draw(entt::registry &world, ThePURGE &game) override; | ||
void event(entt::registry &world, ThePURGE &game, const engine::Event &e) override; | ||
|
||
private: | ||
|
||
}; | ||
|
||
} // namespace game |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
#include <entt/entt.hpp> | ||
|
||
#include "AMenu.hpp" | ||
|
||
namespace game::menu { | ||
|
||
class UpgradePanel : public AMenu { | ||
public: | ||
void draw(entt::registry &world, ThePURGE &game) override; | ||
void event(entt::registry &world, ThePURGE &game, const engine::Event &e) override; | ||
|
||
private: | ||
|
||
}; | ||
|
||
} // namespace game |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.