示例#1
0
 private void PauseGame()
 {
     if (!PauseIsOpened)
     {
         if (pause == null)
         {
             pause = new PauseWindow();
         }
         PauseIsOpened = true;
         GameTime.Stop();
         LevelTime.Stop();
         pause.Show();
         Cursor.Show();
     }
 }
示例#2
0
        public void Update(object sender, EventArgs e)
        {
            degrees += 1;
            player.TriggerTicks++;

            if (player.IsLevelCompleted && !isMessageShowed)
            {
                LevelTime.Stop();
                GameTime.Stop();
                Map.UpdateBestTime();
                ShowMessage();
                isMessageShowed = true;
            }

            if (player.Dead)
            {
                Restart();
            }

            if (player.TriggerTicks != 0)
            {
                player.ReactToOrbs(Map, sizeValue);
            }

            if (player.Moving)
            {
                if (LevelTime.Enabled)
                {
                    player.Move(Map, sizeValue);
                }
                else
                {
                    LevelTime.Start();
                }
            }

            UpdateTimeLabel();
            Invalidate();
        }
示例#3
0
 private void Restart()
 {
     player = new Player(Map.StartPosition, sizeValue);
     LevelTime.Stop();
     Map.ResetTime();
 }