Skip to content

Commit

Permalink
Increase amount of matches needed only every 5 levels for challenge mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Nov 18, 2024
1 parent 6f54c68 commit c4d05ba
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/states/GameStateChallenge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,12 @@ void GameStateChallenge::handleEvents(std::vector<Event> events) {
if (event == Event::CONFIRM) {
this->completed = false;
this->theme.next();
this->board->loadLevel(this->position.x, this->position.y, this->width, this->height, this->moves, ++this->required_matches, ++this->level, ++this->seed);
this->level += 1;
this->seed += 1;
if (this->level % 5 == 0) {
this->required_matches += 1;
}
this->board->loadLevel(this->position.x, this->position.y, this->width, this->height, this->moves, this->required_matches, this->level, this->seed);
}
} else if (this->failed) {
if (event == Event::CONFIRM) {
Expand Down Expand Up @@ -141,7 +146,7 @@ void GameStateChallenge::loadLevel() {

this->moves = 10;
this->level = this->options->getChallengeModeLevel();
this->required_matches = 11 + this->level;
this->required_matches = 11 + (this->level / 5);
this->seed = this->level;


Expand Down

0 comments on commit c4d05ba

Please sign in to comment.