Exemple #1
0
        /// <summary>
        /// Asynchronous method to pause for 500ms in between levels without blocking
        /// </summary>
        private async void NextLevel()
        {
            UI_LB_Level.Text = "Level " + gc.Level;
            UI_P_NextLevel.Show();
            //Wait 500ms
            await Task.Delay(500);

            UI_P_NextLevel.Hide();
        }
Exemple #2
0
 private void AsteROID_Load(object sender, EventArgs e)
 {
     //Hide panels for displaying later and center align them
     UI_P_PausedPanel.Hide();
     UI_P_PausedPanel.Location = new Point(ClientSize.Width / 2 - UI_P_PausedPanel.Width / 2,
                                           ClientSize.Height / 2 - UI_P_PausedPanel.Height * 2);
     UI_P_GameOverPanel.Hide();
     UI_P_GameOverPanel.Location = new Point(ClientSize.Width / 2 - UI_P_GameOverPanel.Width / 2,
                                             ClientSize.Height / 2 - UI_P_GameOverPanel.Height * 2);
     UI_P_NextLevel.Hide();
     UI_P_NextLevel.Location = new Point(ClientSize.Width / 2 - UI_P_NextLevel.Width / 2,
                                         ClientSize.Height / 2 - UI_P_NextLevel.Height * 2);
     gc.StartGame(ClientSize);
 }