Faster and fewe levels to comply with comments on #11

pull/15/head
Dennis Bücker 1 year ago
parent 8c3bcd130a
commit 963dc227af
  1. 3
      src/MCUInfo.h
  2. 4
      src/ShowColorSequence.cpp
  3. 35
      src/SimonSays.cpp

@ -9,7 +9,6 @@ struct MCUInfo
static constexpr int maxColorArrayLength = 10; //maximal array length
static constexpr int initialGameLifes = 3; // lifes to start game with
static constexpr int maxLevel = 10; // Maximum Level number after game is going to 'win' state.
static constexpr int maxLevel = 8; // Maximum Level number after game is going to 'win' state.
};

@ -83,10 +83,10 @@ void ShowColorSequence::update(SimonSays & simonSays)
simonSays.simonDisplay.displayOneColor(CRGB::Black);
if (simonSays.currentSpeed>50)
{
ticksTillNextColor = 25;
ticksTillNextColor = 20;
}
else {
ticksTillNextColor = 13;
ticksTillNextColor = 10;
}
lastDisplayWasColor = false;
}

@ -99,43 +99,44 @@ void SimonSays::generateNewSequence() {
case 0 :
numberOfColors=2;
currentSequenceLength = 3;
currentSpeed = 100;
currentSpeed = 80;
break;
case 1 :
numberOfColors = 2;
numberOfColors = 3;
currentSequenceLength = 4;
currentSpeed = 80;
currentSpeed = 70;
break;
case 2:
numberOfColors = 3;
numberOfColors = 4;
currentSequenceLength = 4;
currentSpeed = 90;
currentSpeed = 60;
break;
case 3:
numberOfColors = 3;
currentSequenceLength = 5;
currentSpeed = 70;
numberOfColors = 4;
currentSequenceLength = 6;
currentSpeed = 50;
break;
case 4:
numberOfColors = 4;
currentSequenceLength = 5;
currentSpeed = 80;
currentSequenceLength = 7;
currentSpeed = 50;
break;
case 5:
numberOfColors = 4;
currentSequenceLength = 6;
currentSpeed = 60;
currentSequenceLength = 8;
currentSpeed = 40;
break;
case 6:
numberOfColors = 5;
currentSequenceLength = 6;
currentSpeed = 70;
currentSequenceLength = 9;
currentSpeed = 40;
break;
case 7:
numberOfColors = 5;
currentSequenceLength = 7;
currentSpeed = 50;
numberOfColors = 6;
currentSequenceLength = 10;
currentSpeed = 30;
break;
// cut with 8 levels
case 8:
numberOfColors = 6;
currentSequenceLength = 7;

Loading…
Cancel
Save