private void PauseGame() { if (!PauseIsOpened) { if (pause == null) { pause = new PauseWindow(); } PauseIsOpened = true; GameTime.Stop(); LevelTime.Stop(); pause.Show(); Cursor.Show(); } }
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(); }
private void Restart() { player = new Player(Map.StartPosition, sizeValue); LevelTime.Stop(); Map.ResetTime(); }