       }
     }
   }
-  
+
   draw(spaceShip.x, spaceShip.y, playerShip, spaceShip.frame);
 }
 

  // TODO DRAW RECT
  arduboy.display();

  while(totalDelay < ATTRACT_MODE_TIMEOUT) {

    if (arduboy.pressed(A_BUTTON) || arduboy.pressed(B_BUTTON)) {
      break;
    }
    
    if (arduboy.pressed(LEFT_BUTTON)) {
      if ( (millis() - lastDebounceTime) > debounceDelay) {
        selectedItem = titleMenuLeftButton(selectedItem);
        lastDebounceTime = millis(); //set the current time
      }
    }
  
    if (arduboy.pressed(RIGHT_BUTTON)) {
      if ( (millis() - lastDebounceTime) > debounceDelay) {
        selectedItem = titleMenuRightButton(selectedItem);

        newHighScoreScreen();
        highScore = score;
      }

      highScoreScreen();
      break;
    case TITLE_SETTINGS:
      settingsScreen();
      break;
    case TITLE_TIMEOUT:
      // No button pressed on title, alternate with high score
      highScoreScreen();
      break;
  }
}
