 
 void EndGame()
 {
+  if(sound == true)
+  {
     arduboy.tunes.tone(200, 200);
     delay(400);
     arduboy.tunes.tone(100, 400);
     delay(600);
     arduboy.tunes.tone(50, 2000);
-    gameRunning = false;
+  }
+    
+  gameState = 'E';
 }
 
 void CollisionDetection()

  // here we set the framerate to 15, we do not need to run at
  // default 60 and it saves us battery life
  arduboy.setFrameRate(30);

 StartGame(); 
}



    
    arduboy.print(scoreBuff);

    if(arduboy.pressed(A_BUTTON) || arduboy.pressed(B_BUTTON)) {
      gameState = 'T';
    }

  }
  else if(gameState == 'T')
  {
    arduboy.setFrameRate(10);
    arduboy.setCursor(50, 1);  
    arduboy.print("Snack");

    arduboy.setCursor(20, 15);  
    arduboy.print("By Shane Powell");
    
    arduboy.setCursor(50, 55);  
    arduboy.print("Sound");

    arduboy.setCursor(90, 55);  
    arduboy.print("On");

    arduboy.setCursor(109, 55);  
    arduboy.print("Off");
   
    if(arduboy.pressed(A_BUTTON) || arduboy.pressed(B_BUTTON)) {
      StartGame();
    }
    else if(arduboy.pressed(LEFT_BUTTON))
    {
      sound = true;
    }
    else if(arduboy.pressed(RIGHT_BUTTON))
    {
      sound = false;
    }

    if(sound == true)
    {
          arduboy.drawRect(88,53, 18, 11, WHITE);
    }
    else
    {
          arduboy.drawRect(107,53, 21, 11, WHITE);
    }
  }

  
