diff --git a/README.md b/README.md index 8a24c33..83c28f7 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ If you want to know more details about the generation and classification of poly - MARATHON : clear 200 lines with increasing gravity! - 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 @@ -56,5 +56,5 @@ If for some reasons you wanna run the command line version: Library used: [SFML 3](https://www.sfml-dev.org/). Font used: [Press Start](https://www.zone38.net/font/#pressstart). -Inspired by other stacker games such as Techmino, jstris, tetr.io, etc. +Inspired by other modern stacker games such as Techmino, jstris, tetr.io, etc. This game isn't affiliated with any of them. diff --git a/src/Core/GameParameters.cpp b/src/Core/GameParameters.cpp index 625c206..87621a1 100644 --- a/src/Core/GameParameters.cpp +++ b/src/Core/GameParameters.cpp @@ -22,6 +22,8 @@ void GameParameters::reset() { case MARATHON : {this->level = 1; break;} // goes from level 20 to 39 case MASTER : {this->level = 20; break;} + // no gravity + case ZEN : {this->level = 0; break;} default : this->level = 1; } @@ -58,6 +60,8 @@ bool GameParameters::hasWon(int framesPassed) const { case MARATHON : return this->clearedLines >= 200; // win once 200 lines have been cleared case MASTER : return this->clearedLines >= 200; + // infinite mode + case ZEN : default : return false; } } @@ -65,13 +69,14 @@ bool GameParameters::hasWon(int framesPassed) const { void GameParameters::updateStats() { /* NEXT QUEUE */ switch (this->gamemode) { - // 5 for rapidity gamemodes + // 5 for fast-controls gamemodes case SPRINT : - case ULTRA : { + case ULTRA : + case ZEN : { this->nextQueueLength = 5; break; } - // 3 for endurance gamemodes + // 3 for slow-controls gamemodes case MARATHON : case MASTER : { this->nextQueueLength = 3; @@ -126,6 +131,8 @@ void GameParameters::updateStats() { switch (this->gamemode) { // starts at 500ms (30f) at lvl 20 and ends at 183ms (11f) at lvl 39 case MASTER : {this->lockDelay = 30 - (this->level - 20); break;} + // 10s + case ZEN : {this->lockDelay = 60 * 10; break;} // 1s by default default : this->lockDelay = 60; } diff --git a/src/Core/Gamemode.h b/src/Core/Gamemode.h index 68a60f8..15f7531 100644 --- a/src/Core/Gamemode.h +++ b/src/Core/Gamemode.h @@ -8,5 +8,6 @@ enum Gamemode { SPRINT, MARATHON, ULTRA, - MASTER + MASTER, + ZEN }; diff --git a/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp index 50abd17..0eb4dc8 100644 --- a/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp +++ b/src/GraphicalUI/AppMenus/GameSettingsAppMenu.cpp @@ -12,7 +12,7 @@ GameSettingsAppMenu::GameSettingsAppMenu(std::shared_ptr menuStack, std::shared_ptr settings, std::shared_ptr renderWindow) : AppMenu(menuStack, settings, renderWindow), - playerCursor(std::vector({2, 3, 1})) { + playerCursor(std::vector({2, 3, 2})) { } @@ -32,7 +32,7 @@ void GameSettingsAppMenu::computeFrame() { case 2 : { switch (this->playerCursor.getPosition().x) { case 0 : {this->settings->setGamemode(MASTER); break;} - case 1 : break; //TODO + case 1 : {this->settings->setGamemode(ZEN); break;} case 2 : break; //TODO } break; @@ -68,7 +68,7 @@ void GameSettingsAppMenu::drawFrame() const { 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, "??? (TODO)", 25.f, 35.f, sf::Vector2u{1, 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}); this->renderWindow->display(); diff --git a/src/GraphicalUI/main.cpp b/src/GraphicalUI/main.cpp index 745bb68..8a60631 100644 --- a/src/GraphicalUI/main.cpp +++ b/src/GraphicalUI/main.cpp @@ -1,6 +1,7 @@ #include "GraphApp.h" #include "../Pieces/PiecesFiles.h" +#include #include