|
|
|
@@ -16,6 +16,7 @@ void c_chaingame::nextPattern(void)
|
|
|
|
|
|
|
|
|
|
|
|
void c_chaingame::runGame(void)
|
|
|
|
void c_chaingame::runGame(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
//check if we are idle
|
|
|
|
if (!patternFlag && !cheatButtonFlag)
|
|
|
|
if (!patternFlag && !cheatButtonFlag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (buttonIsPressed(ledpattern[patternIndex]))
|
|
|
|
if (buttonIsPressed(ledpattern[patternIndex]))
|
|
|
|
@@ -38,12 +39,14 @@ void c_chaingame::runGame(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check if the actual pattern switch is off
|
|
|
|
if (!buttonIsPressed(ledpattern[patternIndex]))
|
|
|
|
if (!buttonIsPressed(ledpattern[patternIndex]))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// pattern switch is open, turn off pattern LED
|
|
|
|
// pattern switch is open, turn off pattern LED
|
|
|
|
turnOffLed(ledpattern[patternIndex]);
|
|
|
|
turnOffLed(ledpattern[patternIndex]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// check if the game is in cheat mode and cheat switch is off
|
|
|
|
if (!buttonIsPressed(cheatbutton) && cheatButtonFlag)
|
|
|
|
if (!buttonIsPressed(cheatbutton) && cheatButtonFlag)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// cheat switch is open, turn of cheat LED
|
|
|
|
// cheat switch is open, turn of cheat LED
|
|
|
|
@@ -52,6 +55,7 @@ void c_chaingame::runGame(void)
|
|
|
|
cheatbutton = 0;
|
|
|
|
cheatbutton = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if all siwtches are off turn all LEDs off
|
|
|
|
if (!anybutton())
|
|
|
|
if (!anybutton())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//all switches are open, turn off all LEDs
|
|
|
|
//all switches are open, turn off all LEDs
|
|
|
|
|