finalized gamemode select menu

This commit is contained in:
2025-03-29 12:31:54 +01:00
parent ec40495328
commit 3538403f40
10 changed files with 61 additions and 18 deletions

View File

@@ -25,7 +25,6 @@ If you want to know more details about the generation and classification of poly
- ULTRA : scores as much as possible in only 2 minutes!
- MASTER : clear 200 lines at levels higher than maximum gravity!
- ZEN : practice indefinitely in this mode with no gravity!
- ??? : still to do
## Manual build

View File

@@ -5,7 +5,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>

View File

@@ -0,0 +1,28 @@
#include "GamePiecesAppMenu.h"
#include "AppMenu.h"
#include "../PlayerCursor.h"
#include <stack>
#include <memory>
#include <SFML/Graphics.hpp>
GamePiecesAppMenu::GamePiecesAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared_ptr<Settings> settings, std::shared_ptr<sf::RenderWindow> renderWindow) :
AppMenu(menuStack, settings, renderWindow),
playerCursor({1}) {
}
void GamePiecesAppMenu::computeFrame() {
this->updateMetaBinds();
this->playerCursor.updatePosition();
if (this->escReleased) {
this->menuStack->pop();
}
}
void GamePiecesAppMenu::drawFrame() const {
}

View File

@@ -0,0 +1,21 @@
#pragma once
#include "AppMenu.h"
#include "../PlayerCursor.h"
#include <stack>
#include <memory>
#include <SFML/Graphics.hpp>
class GamePiecesAppMenu : public AppMenu {
private:
PlayerCursor playerCursor;
public:
GamePiecesAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared_ptr<Settings> settings, std::shared_ptr<sf::RenderWindow> renderWindow);
void computeFrame() override;
void drawFrame() const override;
};

View File

@@ -1,19 +1,19 @@
#include "GameSettingsAppMenu.h"
#include "AppMenu.h"
#include "GamePiecesAppMenu.h"
#include "GameBoardAppMenu.h"
#include "GamePlayingAppMenu.h"
#include "../PlayerCursor.h"
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>
GameSettingsAppMenu::GameSettingsAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared_ptr<Settings> settings, std::shared_ptr<sf::RenderWindow> renderWindow) :
AppMenu(menuStack, settings, renderWindow),
playerCursor({2, 3, 3}) {
playerCursor({2, 3, 2}) {
}
@@ -34,7 +34,6 @@ void GameSettingsAppMenu::computeFrame() {
switch (this->playerCursor.getPosition().x) {
case 0 : {this->settings->setGamemode(MASTER); break;}
case 1 : {this->settings->setGamemode(ZEN); break;}
case 2 : break; //TODO
}
break;
}
@@ -43,7 +42,7 @@ void GameSettingsAppMenu::computeFrame() {
if (this->enterReleased) {
if (this->playerCursor.getPosition().y == 0) {
if (this->playerCursor.getPosition().x == 0) {
//TODO
this->menuStack->push(std::make_shared<GamePiecesAppMenu>(this->menuStack, this->settings, this->renderWindow));
}
if (this->playerCursor.getPosition().x == 1) {
this->menuStack->push(std::make_shared<GameBoardAppMenu>(this->menuStack, this->settings, this->renderWindow));
@@ -67,15 +66,17 @@ void GameSettingsAppMenu::drawFrame() const {
this->placeTitle(text, {}, "GAME SETTINGS", 5.f, {});
this->placeText(text, this->playerCursor, "PIECES SELECT (TODO)", 5.f, 15.f, sf::Vector2u{0, 0});
this->placeText(text, this->playerCursor, "PIECES SELECT", 5.f, 15.f, sf::Vector2u{0, 0});
this->placeText(text, this->playerCursor, "BOARD SELECT", 40.f, 15.f, sf::Vector2u{1, 0});
this->placeText(text, this->playerCursor, "SPRINT", 5.f, 25.f, sf::Vector2u{0, 1});
this->placeText(text, this->playerCursor, "MARATHON", 25.f, 25.f, sf::Vector2u{1, 1});
this->placeText(text, this->playerCursor, "ULTRA", 50.f, 25.f, sf::Vector2u{2, 1});
this->placeText(text, this->playerCursor, "MASTER", 5.f, 35.f, sf::Vector2u{0, 2});
this->placeText(text, this->playerCursor, "ZEN", 25.f, 35.f, sf::Vector2u{1, 2});
this->placeText(text, this->playerCursor, "??? (TODO)", 50.f, 35.f, sf::Vector2u{2, 2});
text.setOutlineThickness(0);
this->placeTitle(text, {}, "GAMEMODE SELECT", 25.f, {});
this->placeText(text, this->playerCursor, "SPRINT", 5.f, 35.f, sf::Vector2u{0, 1});
this->placeText(text, this->playerCursor, "MARATHON", 25.f, 35.f, sf::Vector2u{1, 1});
this->placeText(text, this->playerCursor, "ULTRA", 50.f, 35.f, sf::Vector2u{2, 1});
this->placeText(text, this->playerCursor, "MASTER", 5.f, 45.f, sf::Vector2u{0, 2});
this->placeText(text, this->playerCursor, "ZEN", 25.f, 45.f, sf::Vector2u{1, 2});
this->renderWindow->display();
}

View File

@@ -5,7 +5,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>

View File

@@ -8,7 +8,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>

View File

@@ -5,7 +5,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>

View File

@@ -5,7 +5,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <string>
#include <regex>
#include <filesystem>

View File

@@ -7,7 +7,6 @@
#include <stack>
#include <memory>
#include <vector>
#include <SFML/Graphics.hpp>