public void ResetLevelCommand() { Player1Camera.Limits = level.LevelAreas[0]; _backgroundP1 = new Background(spriteBatch, Player1Camera, BackgroundType.Overworld); if (Mode == GameMode.MultiPlayer) { Player2Camera.Limits = level.LevelAreas[0]; _backgroundP2 = new Background(spriteBatch, Player2Camera, BackgroundType.Overworld); } gameGrid.ClearGrid(); SoundPool.Instance.Reset(); foreach (HUD hud in HUDs) { hud.Dispose(); } HUDs.Clear(); level.Grid = gameGrid; level.Create(); Player1Camera.LookAt(Player1.Position); if (Mode == GameMode.MultiPlayer) { Player2Camera.LookAt(Player2.Position); } State = GameState.Playing; }
public void StartSinglePlayerRun() { Mode = GameMode.SinglePlayer; player2Controller.Clear(); SetupSingleplayerViewport(); _backgroundP1 = new Background(spriteBatch, Player1Camera, BackgroundType.Overworld); gameGrid.ClearGrid(); SoundPool.Instance.Reset(); foreach (HUD hud in HUDs) { hud.Dispose(); } HUDs.Clear(); level.Grid = gameGrid; level.Create(); Player1Camera.LookAt(Player1.Position); Player2 = Player1; Player2Camera = Player1Camera; State = GameState.Playing; }
public void StartMultiPlayerRun(MultiplayerType type) { Mode = GameMode.MultiPlayer; MultiplayerMode = type; player2Controller.Clear(); Player2 = null; SetupMultiplayerViewports(); _backgroundP1 = new Background(spriteBatch, Player1Camera, BackgroundType.Overworld); _backgroundP2 = new Background(spriteBatch, Player2Camera, BackgroundType.Overworld); gameGrid.ClearGrid(); SoundPool.Instance.Reset(); foreach (HUD hud in HUDs) { hud.Dispose(); } HUDs.Clear(); level.Grid = gameGrid; level.Create(); MapPlayer2Controller(); Player1Camera.LookAt(Player1.Position); Player2Camera.LookAt(Player2.Position); State = GameState.Playing; }
public static string GetHUDSceneName(HUDs HUDScene) { string name = null; switch (HUDScene) { case HUDs.playing: name = "UIMain"; break; default: name = ""; break; } return(name); }