   redAlert();
 }
 
+/*******************************************************************************
+ * POST GAME SCREENS AND SUPPORTING FUNCTIONS                                  *
+ *******************************************************************************/
+
+// Game has ended.
 void gameOverScreen() {
   stopMusic();
   arduboy.clear();

  persistHighScoreTable(false);
}

void createStarFieldVals() {
  for (byte i = 0; i < NUM_STARS; i++) {
      setStarValuesForIndex(i);
  } 
}

void resetEnemies() {
  for (byte i = 0; i < MAX_ENEMIES; i++) {
    enemies[i].health = 0; 
    enemies[i].bullets[0].hide();
  }
}

void resetBoss() {
  boss.health = 0;
  boss.dying = 0;
  for (byte i = 0; i < MAX_BOSS_BULLETS; i++) {
    boss.bullets[i].hide();
  }
}

void resetPlayerBullets() {
  for (byte i = 0; i < MAX_PLAYER_BULLETS; i++) {
    playerBullets[i].hide();
  }
}

void setStarValuesForIndex(byte i) {
  starX[i] = random(250);
  starY[i] = random(11, 64);
  starWidth[i] = random(1, 4);  

  if (starWidth[i] >= 3) {
    starSpeed[i] = random(30, 40) * 0.01f;
  }
  else if (starWidth[i] >= 2) {
    starSpeed[i] = random(18, 25) * 0.01f;
  }
  else {
    starSpeed[i] = random(7, 12) * 0.01f;
  }
}

void updateStarFieldVals() {
  for (byte i = 0; i < NUM_STARS; i++) {
    if (starX[i] < -1) {
      setStarValuesForIndex(i);
      starX[i] = 128 + random(20);
      starY[i] = random(11, 64);
    }   
    else {
      starX[i] -= starSpeed[i];
    }
  }
}

/*******************************************************************************
 * ENTRY POINTS                                                                *
 *******************************************************************************/

void setup() {
  arduboy.beginNoLogo();
    

  }
}

// Select (color = 1) / deselect (color = 0)  the sound item for the settings screen.
void drawBoxAroundSoundSetting(byte color) {
   arduboy.drawRect(17, 22, 35, 13, color);
}

// Toggle the sound on / off message for the settings screen.
void printsoundOnOff() {
  printText(soundOn ? "SOUND ON " : "SOUND OFF", 20, 25, 1);
  drawBoxAroundSoundSetting(1);
}

/*******************************************************************************
 * IN GAME SCREENS AND SUPPORTING FUNCTIONS                                    *
 *******************************************************************************/

// Play the game!
void playGame() {
  stopMusic();

