Example #1
0
        private void Select5(object sender, EventArgs e)
        {//creates a new level 5 form when you select level 5 then closes the level select form
            Level5 Level_5 = new Level5();

            Level_5.Show();
            Level_5.Location = this.Location;
            Level_5.TopMost  = true;
            this.Close();
        }
Example #2
0
 private void KeyIsUp(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Left)
     {
         goLeft = false;
     }
     if (e.KeyCode == Keys.Right)
     {
         goRight = false;
     }
     if (jumping == true)
     {
         jumping = false;
     }
     if (e.KeyCode == Keys.Enter && isGameOver == true)
     {
         RestartGame();
     }
     // Go to level 5 When you win
     if (e.KeyCode == Keys.Enter && Win == true)
     {
         Level5 Level_5 = new Level5();
         Level_5.Show();
         Level_5.Location = this.Location;
         Level_5.TopMost  = true;
         this.Close();
     }
     //press esc to get back to main menu
     if (e.KeyCode == Keys.Escape && Win == false)
     {
         MainMenu main = new MainMenu();
         main.Show();
         main.Location = this.Location;
         main.TopMost  = true;
         this.Close();
     }
 }