         // Wait for a button press.
         int simonLed = -1;
         while (simonLed == -1) {
+
+            // Check for game reset.
+            if (digitalRead(TILT)) return true;
+
+            // Check for a button press.
             simonLed = getSimonLed(analogRead(BUTTONS));
         }
 

    // Begin the game.
    playGame(pattern);

    // The game is over, so turn off all lights and reset the game.
    for (int i = 0; i < QTY; i++) {
        digitalWrite(LEDS[i], LOW);
        gameStart = false;

    // Set game parameters then begin.
    int lives = TOTAL_LIVES;
    int currentLevel = 1;
    while (gameStart && lives > 0 && currentLevel < TOTAL_LEVELS) {

        // Display the pattern.
        for (int lvl = 0; lvl < currentLevel; lvl++) {
