finalized gamemode select menu
This commit is contained in:
@@ -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!
|
- ULTRA : scores as much as possible in only 2 minutes!
|
||||||
- MASTER : clear 200 lines at levels higher than maximum gravity!
|
- MASTER : clear 200 lines at levels higher than maximum gravity!
|
||||||
- ZEN : practice indefinitely in this mode with no gravity!
|
- ZEN : practice indefinitely in this mode with no gravity!
|
||||||
- ??? : still to do
|
|
||||||
|
|
||||||
## Manual build
|
## Manual build
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
28
src/GraphicalUI/AppMenus/GamePiecesAppMenu.cpp
Normal file
28
src/GraphicalUI/AppMenus/GamePiecesAppMenu.cpp
Normal 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 {
|
||||||
|
|
||||||
|
}
|
||||||
21
src/GraphicalUI/AppMenus/GamePiecesAppMenu.h
Normal file
21
src/GraphicalUI/AppMenus/GamePiecesAppMenu.h
Normal 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;
|
||||||
|
};
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
#include "GameSettingsAppMenu.h"
|
#include "GameSettingsAppMenu.h"
|
||||||
|
|
||||||
#include "AppMenu.h"
|
#include "AppMenu.h"
|
||||||
|
#include "GamePiecesAppMenu.h"
|
||||||
#include "GameBoardAppMenu.h"
|
#include "GameBoardAppMenu.h"
|
||||||
#include "GamePlayingAppMenu.h"
|
#include "GamePlayingAppMenu.h"
|
||||||
#include "../PlayerCursor.h"
|
#include "../PlayerCursor.h"
|
||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
GameSettingsAppMenu::GameSettingsAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared_ptr<Settings> settings, std::shared_ptr<sf::RenderWindow> renderWindow) :
|
GameSettingsAppMenu::GameSettingsAppMenu(std::shared_ptr<MenuStack> menuStack, std::shared_ptr<Settings> settings, std::shared_ptr<sf::RenderWindow> renderWindow) :
|
||||||
AppMenu(menuStack, settings, 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) {
|
switch (this->playerCursor.getPosition().x) {
|
||||||
case 0 : {this->settings->setGamemode(MASTER); break;}
|
case 0 : {this->settings->setGamemode(MASTER); break;}
|
||||||
case 1 : {this->settings->setGamemode(ZEN); break;}
|
case 1 : {this->settings->setGamemode(ZEN); break;}
|
||||||
case 2 : break; //TODO
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -43,7 +42,7 @@ void GameSettingsAppMenu::computeFrame() {
|
|||||||
if (this->enterReleased) {
|
if (this->enterReleased) {
|
||||||
if (this->playerCursor.getPosition().y == 0) {
|
if (this->playerCursor.getPosition().y == 0) {
|
||||||
if (this->playerCursor.getPosition().x == 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) {
|
if (this->playerCursor.getPosition().x == 1) {
|
||||||
this->menuStack->push(std::make_shared<GameBoardAppMenu>(this->menuStack, this->settings, this->renderWindow));
|
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->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, "BOARD SELECT", 40.f, 15.f, sf::Vector2u{1, 0});
|
||||||
|
|
||||||
this->placeText(text, this->playerCursor, "SPRINT", 5.f, 25.f, sf::Vector2u{0, 1});
|
text.setOutlineThickness(0);
|
||||||
this->placeText(text, this->playerCursor, "MARATHON", 25.f, 25.f, sf::Vector2u{1, 1});
|
this->placeTitle(text, {}, "GAMEMODE SELECT", 25.f, {});
|
||||||
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, "SPRINT", 5.f, 35.f, sf::Vector2u{0, 1});
|
||||||
this->placeText(text, this->playerCursor, "ZEN", 25.f, 35.f, sf::Vector2u{1, 2});
|
this->placeText(text, this->playerCursor, "MARATHON", 25.f, 35.f, sf::Vector2u{1, 1});
|
||||||
this->placeText(text, this->playerCursor, "??? (TODO)", 50.f, 35.f, sf::Vector2u{2, 2});
|
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();
|
this->renderWindow->display();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
|
||||||
#include <SFML/Graphics.hpp>
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user