Пример #1
0
        /// <summary>
        /// Load any content (textures, fonts, etc) required for this state.
        /// </summary>
        public override void LoadContent()
        {
            visibleTiles = new DrawableTile[map.Width * map.Height];
            FillTiles();

            miniMap = new Minimap(Players, localPlayer);
            miniMap.SetMap(map, this);

            Scene.CreateCamera(
                new Vector3(localPlayer.Position.X, localPlayer.Position.Y, GamePlayState.DefaultCameraDistance),
                new Vector3(localPlayer.Position.X, localPlayer.Position.Y, 0),
                Matrix.CreatePerspectiveFieldOfView(
                    MathHelper.PiOver4,
                    (float)GraphicOptions.graphics.GraphicsDevice.Viewport.Width /
                    (float)GraphicOptions.graphics.GraphicsDevice.Viewport.Height,
                    10f,
                    5000f),
                OverheadCamera);
            Scene.SwitchCamera(OverheadCamera);
            Scene.AccessCamera(OverheadCamera).Follow(localPlayer);

            Scene.CreateCamera(
                localPlayer.Position - localPlayer.Front * 1000 + localPlayer.Up * 400,
                localPlayer.Position + new Vector3(0, 0, 100),
                renderer.ActiveScene.AccessCamera(OverheadCamera).Projection,
                ChaseCamera);
            Scene.AccessCamera(ChaseCamera).CameraUp = Vector3.UnitZ;

            timeLeft = ServiceManager.Theater.TimeLeftSeconds;
            ServiceManager.Game.Renderer.ActiveScene.SwitchCamera(ChaseCamera);
            ServiceManager.Game.Renderer.ActiveScene.CurrentCamera.LockTo(localPlayer, new Vector3(-500, 0, 200), new Vector3(0, 0, 75));
            ServiceManager.Game.Renderer.ActiveScene.LockCameras();
            callback.Ready = true;

            ServiceManager.Theater.Ready();
        }