/// <summary> /// Tests level as the player. /// </summary> public static void TestLevel() { if (TMBAW_Game.CurrentGameMode != GameMode.Play && _switchEditAndPlayTimer.TimeElapsedInMilliSeconds > 1000) { try { SaveLevel(); GameWorld.IsTestingLevel = true; GameWorld.PlayerTrail = new PlayerTrail(); TMBAW_Game.CurrentGameMode = GameMode.Play; GameWorld.PrepareLevelForTesting(); foreach (Player player in GameWorld.GetPlayers()) { player.ComplexAnimation.RemoveAllFromQueue(); player.SetVelX(0); player.SetVelY(0); } Overlay.FlashWhite(); _switchEditAndPlayTimer.Reset(); _testSound.Play(); Cursor.Hide(); // DataFolder.PlayLevel(DataFolder.CurrentLevelFilePath); } catch (Exception e) { TMBAW_Game.MessageBox.Show(e.Message); } } }
public static void GoBackToEditing() { if (TMBAW_Game.CurrentGameMode != GameMode.Edit && _switchEditAndPlayTimer.TimeElapsedInMilliSeconds > 1000) { try { GameWorld.IsTestingLevel = false; TMBAW_Game.CurrentGameMode = GameMode.Edit; GameWorld.PrepareLevelForTesting(); Overlay.FlashWhite(); _switchEditAndPlayTimer.Reset(); _testSound.Play(); Cursor.Show(); // DataFolder.PlayLevel(DataFolder.CurrentLevelFilePath); } catch (Exception e) { TMBAW_Game.MessageBox.Show(e.Message); } } }