added ZEN gamemode
This commit is contained in:
@@ -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!
|
- MARATHON : clear 200 lines with increasing gravity!
|
||||||
- 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!
|
||||||
- ??? : ???
|
- ??? : still to do
|
||||||
|
|
||||||
## Manual build
|
## 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/).
|
Library used: [SFML 3](https://www.sfml-dev.org/).
|
||||||
Font used: [Press Start](https://www.zone38.net/font/#pressstart).
|
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.
|
This game isn't affiliated with any of them.
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ void GameParameters::reset() {
|
|||||||
case MARATHON : {this->level = 1; break;}
|
case MARATHON : {this->level = 1; break;}
|
||||||
// goes from level 20 to 39
|
// goes from level 20 to 39
|
||||||
case MASTER : {this->level = 20; break;}
|
case MASTER : {this->level = 20; break;}
|
||||||
|
// no gravity
|
||||||
|
case ZEN : {this->level = 0; break;}
|
||||||
default : this->level = 1;
|
default : this->level = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,6 +60,8 @@ bool GameParameters::hasWon(int framesPassed) const {
|
|||||||
case MARATHON : return this->clearedLines >= 200;
|
case MARATHON : return this->clearedLines >= 200;
|
||||||
// win once 200 lines have been cleared
|
// win once 200 lines have been cleared
|
||||||
case MASTER : return this->clearedLines >= 200;
|
case MASTER : return this->clearedLines >= 200;
|
||||||
|
// infinite mode
|
||||||
|
case ZEN :
|
||||||
default : return false;
|
default : return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -65,13 +69,14 @@ bool GameParameters::hasWon(int framesPassed) const {
|
|||||||
void GameParameters::updateStats() {
|
void GameParameters::updateStats() {
|
||||||
/* NEXT QUEUE */
|
/* NEXT QUEUE */
|
||||||
switch (this->gamemode) {
|
switch (this->gamemode) {
|
||||||
// 5 for rapidity gamemodes
|
// 5 for fast-controls gamemodes
|
||||||
case SPRINT :
|
case SPRINT :
|
||||||
case ULTRA : {
|
case ULTRA :
|
||||||
|
case ZEN : {
|
||||||
this->nextQueueLength = 5;
|
this->nextQueueLength = 5;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// 3 for endurance gamemodes
|
// 3 for slow-controls gamemodes
|
||||||
case MARATHON :
|
case MARATHON :
|
||||||
case MASTER : {
|
case MASTER : {
|
||||||
this->nextQueueLength = 3;
|
this->nextQueueLength = 3;
|
||||||
@@ -126,6 +131,8 @@ void GameParameters::updateStats() {
|
|||||||
switch (this->gamemode) {
|
switch (this->gamemode) {
|
||||||
// starts at 500ms (30f) at lvl 20 and ends at 183ms (11f) at lvl 39
|
// starts at 500ms (30f) at lvl 20 and ends at 183ms (11f) at lvl 39
|
||||||
case MASTER : {this->lockDelay = 30 - (this->level - 20); break;}
|
case MASTER : {this->lockDelay = 30 - (this->level - 20); break;}
|
||||||
|
// 10s
|
||||||
|
case ZEN : {this->lockDelay = 60 * 10; break;}
|
||||||
// 1s by default
|
// 1s by default
|
||||||
default : this->lockDelay = 60;
|
default : this->lockDelay = 60;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,5 +8,6 @@ enum Gamemode {
|
|||||||
SPRINT,
|
SPRINT,
|
||||||
MARATHON,
|
MARATHON,
|
||||||
ULTRA,
|
ULTRA,
|
||||||
MASTER
|
MASTER,
|
||||||
|
ZEN
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
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(std::vector<unsigned int>({2, 3, 1})) {
|
playerCursor(std::vector<unsigned int>({2, 3, 2})) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ void GameSettingsAppMenu::computeFrame() {
|
|||||||
case 2 : {
|
case 2 : {
|
||||||
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 : break; //TODO
|
case 1 : {this->settings->setGamemode(ZEN); break;}
|
||||||
case 2 : break; //TODO
|
case 2 : break; //TODO
|
||||||
}
|
}
|
||||||
break;
|
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, "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, "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, "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->placeText(text, this->playerCursor, "??? (TODO)", 50.f, 35.f, sf::Vector2u{2, 2});
|
||||||
|
|
||||||
this->renderWindow->display();
|
this->renderWindow->display();
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "GraphApp.h"
|
#include "GraphApp.h"
|
||||||
#include "../Pieces/PiecesFiles.h"
|
#include "../Pieces/PiecesFiles.h"
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user