예제 #1
0
        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;
        }
예제 #2
0
        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;
        }
예제 #3
0
        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;
        }
예제 #4
0
    public static string GetHUDSceneName(HUDs HUDScene)
    {
        string name = null;

        switch (HUDScene)
        {
        case HUDs.playing:
            name = "UIMain";
            break;

        default:
            name = "";
            break;
        }
        return(name);
    }