diff --git a/README.md b/README.md
index 243c716..eeb3e1a 100644
--- a/README.md
+++ b/README.md
@@ -23,3 +23,7 @@ Note that the program will genereate the polyomino files for you. This can be qu
If for some reasons you wanna run the command line version:
``xmake run text``
+
+## Credits
+
+Font used: [Press Start](https://www.zone38.net/font/#pressstart).
diff --git a/data/fonts/arial.ttf b/data/fonts/arial.ttf
deleted file mode 100644
index ff0815c..0000000
Binary files a/data/fonts/arial.ttf and /dev/null differ
diff --git a/data/fonts/pressstart/license.txt b/data/fonts/pressstart/license.txt
new file mode 100644
index 0000000..8f7b275
--- /dev/null
+++ b/data/fonts/pressstart/license.txt
@@ -0,0 +1,17 @@
+Thanks for downloading one of codeman38's retro video game fonts, as seen on Memepool, BoingBoing, and all around the blogosphere.
+
+So, you're wondering what the license is for these fonts? Pretty simple; it's based upon that used for Bitstream's Vera font set .
+
+Basically, here are the key points summarized, in as little legalese as possible; I hate reading license agreements as much as you probably do:
+
+With one specific exception, you have full permission to bundle these fonts in your own free or commercial projects-- and by projects, I'm referring to not just software but also electronic documents and print publications.
+
+So what's the exception? Simple: you can't re-sell these fonts in a commercial font collection. I've seen too many font CDs for sale in stores that are just a repackaging of thousands of freeware fonts found on the internet, and in my mind, that's quite a bit like highway robbery. Note that this *only* applies to products that are font collections in and of themselves; you may freely bundle these fonts with an operating system, application program, or the like.
+
+Feel free to modify these fonts and even to release the modified versions, as long as you change the original font names (to ensure consistency among people with the font installed) and as long as you give credit somewhere in the font file to codeman38 or zone38.net. I may even incorporate these changes into a later version of my fonts if you wish to send me the modifed fonts via e-mail.
+
+Also, feel free to mirror these fonts on your own site, as long as you make it reasonably clear that these fonts are not your own work. I'm not asking for much; linking to zone38.net or even just mentioning the nickname codeman38 should be enough.
+
+Well, that pretty much sums it up... so without further ado, install and enjoy these fonts from the golden age of video games.
+
+[ codeman38 | cody@zone38.net | http://www.zone38.net/ ]
\ No newline at end of file
diff --git a/data/fonts/pressstart/prstart.ttf b/data/fonts/pressstart/prstart.ttf
new file mode 100644
index 0000000..40ca6b6
Binary files /dev/null and b/data/fonts/pressstart/prstart.ttf differ
diff --git a/data/fonts/pressstart/prstartk.ttf b/data/fonts/pressstart/prstartk.ttf
new file mode 100644
index 0000000..e9d3c15
Binary files /dev/null and b/data/fonts/pressstart/prstartk.ttf differ
diff --git a/src/GraphicalUI/AppMenus/InGameAppMenu.cpp b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp
similarity index 93%
rename from src/GraphicalUI/AppMenus/InGameAppMenu.cpp
rename to src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp
index 6e1b552..ff15acb 100644
--- a/src/GraphicalUI/AppMenus/InGameAppMenu.cpp
+++ b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.cpp
@@ -1,4 +1,4 @@
-#include "InGameAppMenu.h"
+#include "GamePlayingAppMenu.h"
#include "AppMenu.h"
@@ -7,7 +7,7 @@
#include
-InGameAppMenu::InGameAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow) :
+GamePlayingAppMenu::GamePlayingAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow) :
AppMenu(menuStack, settings, renderWindow),
game(this->settings->getMenu().startGame(this->settings->getGamemode()))
{
@@ -16,7 +16,7 @@ InGameAppMenu::InGameAppMenu(std::shared_ptr menuStack, std::shared_p
this->paused = false;
}
-void InGameAppMenu::computeFrame() {
+void GamePlayingAppMenu::computeFrame() {
this->updateMetaBinds();
if (this->escReleased) {
@@ -46,7 +46,7 @@ void InGameAppMenu::computeFrame() {
}
}
-void InGameAppMenu::drawFrame() const {
+void GamePlayingAppMenu::drawFrame() const {
this->renderWindow->clear(sf::Color::Black);
int sizeMultiplier = this->settings->getWindowSizeMultiplier();
diff --git a/src/GraphicalUI/AppMenus/InGameAppMenu.h b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.h
similarity index 54%
rename from src/GraphicalUI/AppMenus/InGameAppMenu.h
rename to src/GraphicalUI/AppMenus/GamePlayingAppMenu.h
index ec31ffb..e903cc1 100644
--- a/src/GraphicalUI/AppMenus/InGameAppMenu.h
+++ b/src/GraphicalUI/AppMenus/GamePlayingAppMenu.h
@@ -7,13 +7,13 @@
#include
-class InGameAppMenu : public AppMenu {
+class GamePlayingAppMenu : public AppMenu {
private:
Game game;
bool paused;
public:
- InGameAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow);
+ GamePlayingAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow);
void computeFrame();
diff --git a/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp
new file mode 100644
index 0000000..a16d878
--- /dev/null
+++ b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp
@@ -0,0 +1,91 @@
+#include "GameSettingsAppMenu.h"
+
+#include "AppMenu.h"
+#include "GamePlayingAppMenu.h"
+#include "PlayerCursor.h"
+
+#include
+#include
+#include
+#include
+
+
+GameSettingsAppMenu::GameSettingsAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow) :
+ AppMenu(menuStack, settings, renderWindow),
+ playerCursor(std::vector({2, 3, 1})) {
+
+}
+
+void GameSettingsAppMenu::computeFrame() {
+ this->updateMetaBinds();
+ this->playerCursor.updatePosition();
+
+ switch (this->playerCursor.getPosition().y) {
+ case 1 : {
+ switch (this->playerCursor.getPosition().x) {
+ case 0 : {this->settings->setGamemode(SPRINT); break;}
+ case 1 : {this->settings->setGamemode(MARATHON); break;}
+ case 2 : {this->settings->setGamemode(ULTRA); break;}
+ }
+ break;
+ }
+ case 2 : {
+ switch (this->playerCursor.getPosition().x) {
+ case 0 : {this->settings->setGamemode(MASTER); break;}
+ case 1 : break; //TODO
+ case 2 : break; //TODO
+ }
+ break;
+ }
+ }
+
+ if (this->enterReleased) {
+ if (this->playerCursor.getPosition().y == 0) {
+ //TODO
+ }
+ if (this->playerCursor.getPosition().y > 0) {
+ this->menuStack->push(std::make_shared(this->menuStack, this->settings, this->renderWindow));
+ }
+ }
+ if (this->escReleased) {
+ this->menuStack->pop();
+ }
+}
+
+void GameSettingsAppMenu::drawFrame() const {
+ this->renderWindow->clear(sf::Color(200, 200, 200));
+
+
+ sf::Font font("data/fonts/pressstart/prstartk.ttf");
+ sf::Text text(font, "", this->settings->getWindowSizeMultiplier() * 2);
+ text.setFillColor(sf::Color(0, 0, 0));
+ text.setOutlineColor(sf::Color(255, 255, 255));
+
+ text.setString("GAME SETTINGS");
+ text.setOrigin(text.getLocalBounds().getCenter());
+ text.setPosition(sf::Vector2f({(float) this->settings->getWindowSizeMultiplier() * 40, (float) this->settings->getWindowSizeMultiplier() * 5}));
+ this->renderWindow->draw(text);
+
+ this->placeText(text, "PIECES SELECT", 5.f, 15.f, 0, 0);
+ this->placeText(text, "BOARD SELECT", 40.f, 15.f, 1, 0);
+
+ this->placeText(text, "SPRINT", 5.f, 25.f, 0, 1);
+ this->placeText(text, "MARATHON", 25.f, 25.f, 1, 1);
+ this->placeText(text, "ULTRA", 50.f, 25.f, 2, 1);
+ this->placeText(text, "MASTER", 5.f, 35.f, 0, 2);
+ this->placeText(text, "TODO", 25.f, 35.f, 1, 2);
+ this->placeText(text, "TOOD", 50.f, 35.f, 2, 2);
+
+ this->renderWindow->display();
+}
+
+void GameSettingsAppMenu::placeText(sf::Text& text, const sf::String& string, float xPos, float yPos, unsigned int xCursorOutline, unsigned int yCursorOutline) const {
+ float sizeMultiplier = this->settings->getWindowSizeMultiplier();
+
+ text.setString(string);
+ text.setOutlineThickness((this->playerCursor.getPosition().x == xCursorOutline
+ && this->playerCursor.getPosition().y == yCursorOutline) ? (sizeMultiplier / 2) : 0);
+ text.setOrigin(sf::Vector2f({0, text.getLocalBounds().size.y / 2}));
+ text.setPosition(sf::Vector2f({sizeMultiplier * xPos, sizeMultiplier * yPos}));
+ this->renderWindow->draw(text);
+}
diff --git a/src/GraphicalUI/AppMenus/GameSettingsAppMenu.h b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.h
new file mode 100644
index 0000000..1682809
--- /dev/null
+++ b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.h
@@ -0,0 +1,23 @@
+#pragma once
+
+#include "AppMenu.h"
+#include "PlayerCursor.h"
+
+#include
+#include
+#include
+
+
+class GameSettingsAppMenu : public AppMenu {
+ private:
+ PlayerCursor playerCursor;
+
+ public:
+ GameSettingsAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow);
+
+ void computeFrame();
+
+ void drawFrame() const;
+
+ void placeText(sf::Text& text, const sf::String& string, float xPos, float yPos, unsigned int xCursorOutline, unsigned int yCursorOutline) const ;
+};
diff --git a/src/GraphicalUI/AppMenus/MainAppMenu.cpp b/src/GraphicalUI/AppMenus/MainAppMenu.cpp
index d9ce4f0..9e6e115 100644
--- a/src/GraphicalUI/AppMenus/MainAppMenu.cpp
+++ b/src/GraphicalUI/AppMenus/MainAppMenu.cpp
@@ -1,10 +1,12 @@
#include "MainAppMenu.h"
#include "AppMenu.h"
-#include "InGameAppMenu.h"
+#include "GameSettingsAppMenu.h"
+#include "PlayerCursor.h"
#include
#include
+#include
#include
@@ -20,7 +22,13 @@ void MainAppMenu::computeFrame() {
if (this->enterReleased) {
if (this->playerCursor.getPosition().y == 0) {
- this->menuStack->push(std::make_shared(this->menuStack, this->settings, this->renderWindow));
+ this->menuStack->push(std::make_shared(this->menuStack, this->settings, this->renderWindow));
+ }
+ if (this->playerCursor.getPosition().y == 1) {
+ //TODO
+ }
+ if (this->playerCursor.getPosition().y == 2) {
+ //TODO
}
}
if (this->escReleased) {
@@ -33,29 +41,29 @@ void MainAppMenu::drawFrame() const {
float sizeMultiplier = this->settings->getWindowSizeMultiplier();
- sf::Font font("data/fonts/arial.ttf");
- sf::Text text(font, "", this->settings->getWindowSizeMultiplier() * 5);
+ sf::Font font("data/fonts/pressstart/prstartk.ttf");
+ sf::Text text(font, "", this->settings->getWindowSizeMultiplier() * 2);
text.setFillColor(sf::Color(0, 0, 0));
text.setOutlineColor(sf::Color(255, 255, 255));
- text.setString("jminos");
+ text.setString("JMINOS");
text.setOrigin(text.getLocalBounds().getCenter());
text.setPosition(sf::Vector2f({sizeMultiplier * 40, sizeMultiplier * 10}));
this->renderWindow->draw(text);
- text.setString("Play");
+ text.setString("PLAY");
text.setOutlineThickness((this->playerCursor.getPosition().y == 0) ? (sizeMultiplier / 2) : 0);
text.setOrigin(text.getLocalBounds().getCenter());
text.setPosition(sf::Vector2f({sizeMultiplier * 40, sizeMultiplier * 20}));
this->renderWindow->draw(text);
- text.setString("Settings");
+ text.setString("SETTINGS");
text.setOutlineThickness((this->playerCursor.getPosition().y == 1) ? (sizeMultiplier / 2) : 0);
text.setOrigin(text.getLocalBounds().getCenter());
text.setPosition(sf::Vector2f({sizeMultiplier * 40, sizeMultiplier * 30}));
this->renderWindow->draw(text);
- text.setString("Info");
+ text.setString("INFO");
text.setOutlineThickness((this->playerCursor.getPosition().y == 2) ? (sizeMultiplier / 2) : 0);
text.setOrigin(text.getLocalBounds().getCenter());
text.setPosition(sf::Vector2f({sizeMultiplier * 40, sizeMultiplier * 40}));
diff --git a/src/GraphicalUI/AppMenus/PlayerCursor.cpp b/src/GraphicalUI/AppMenus/PlayerCursor.cpp
index f03f0b3..40beb92 100644
--- a/src/GraphicalUI/AppMenus/PlayerCursor.cpp
+++ b/src/GraphicalUI/AppMenus/PlayerCursor.cpp
@@ -86,7 +86,7 @@ void PlayerCursor::moveUp() {
this->position.y--;
}
- if (this->position.x > this->rows.at(this->position.y)) {
+ if (this->position.x >= this->rows.at(this->position.y)) {
this->position.x = this->rows.at(this->position.y) - 1;
}
}
@@ -99,7 +99,7 @@ void PlayerCursor::moveDown() {
this->position.y++;
}
- if (this->position.x > this->rows.at(this->position.y)) {
+ if (this->position.x >= this->rows.at(this->position.y)) {
this->position.x = this->rows.at(this->position.y) - 1;
}
}
diff --git a/src/GraphicalUI/Settings.cpp b/src/GraphicalUI/Settings.cpp
index b25f93c..58b8a76 100644
--- a/src/GraphicalUI/Settings.cpp
+++ b/src/GraphicalUI/Settings.cpp
@@ -7,7 +7,7 @@
#include
static const sf::Vector2u BASE_WINDOW_SIZE = {80, 50};
-static const int WINDOW_SIZE_MULTIPLIERS[] = {4, 6, 9, 14, 20};
+static const int WINDOW_SIZE_MULTIPLIERS[] = {4, 6, 10, 14, 20};
static const int WINDOW_SIZE_LAST_MODE = (sizeof(WINDOW_SIZE_MULTIPLIERS) / sizeof(int)) - 1;