public GameCamera(Scene _currentScene, Vector3 _position, Quaternion _rotation, float _aspectRatio) { currentScene = _currentScene; position = _position; rotation = _rotation; aspectRatio = _aspectRatio; up = new Vector3(0, 1, 0); target = new Vector3(); viewMatrix = Matrix.CreateLookAt(position, target, up); projectionMatrix = Matrix.CreatePerspectiveFieldOfView( MathHelper.ToRadians(45.0f), aspectRatio, 0.1f, VIEW_DEPTH); viewPort = Space394Game.GameInstance.GraphicsDevice.Viewport; fourthPort = new Viewport( Space394Game.GameInstance.DefaultViewPort.Width / 2 + 1, Space394Game.GameInstance.DefaultViewPort.Height / 2 + 1, Space394Game.GameInstance.DefaultViewPort.Width / 2 - 1, Space394Game.GameInstance.DefaultViewPort.Height / 2 - 1); splitScreen2 = new AutoTexture2D(Space394Game.GameInstance.Content.Load<Texture2D>("Textures\\splitScreen2"), Vector2.Zero); splitScreen3 = new AutoTexture2D(Space394Game.GameInstance.Content.Load<Texture2D>("Textures\\splitScreen3"), Vector2.Zero); splitScreen4 = new AutoTexture2D(Space394Game.GameInstance.Content.Load<Texture2D>("Textures\\splitScreen4"), Vector2.Zero); blackTexture = new AutoTexture2D(Space394Game.GameInstance.Content.Load<Texture2D>("Textures\\blackTexture"), Vector2.Zero); blackTexture.Width = fourthPort.Width; blackTexture.Height = fourthPort.Height; pausedTexture = new AutoTexture2D(Space394Game.GameInstance.Content.Load<Texture2D>("Textures\\pausedTexture"), Vector2.Zero); }
public PlayerCamera(Scene _currentScene, Vector3 _position, Quaternion _rotation, float _aspectRatio) : base(_currentScene, _position, _rotation, _aspectRatio) { // Positions and orients the GameObject viewMatrix = Matrix.CreateRotationX(0) * Matrix.CreateRotationY(0) * Matrix.CreateRotationZ(0) * Matrix.CreateTranslation(0, 3, -10); }
public override void Exit(Scene nextScene) { SceneObjects.Clear(); base.Exit(nextScene); }
public void setPlayerCamera(Scene scene) { playerCamera = new PlayerCamera(scene,Vector3.Zero, new Quaternion(), Space394Game.GameInstance.AspectRatio); PlayerCamera.playerInit(new Vector3(0.0f, 0.0f, 0.5f), this); }
public virtual void onAddToScene(Scene scene) { // Do nothing }
public virtual void Exit(Scene nextScene) { ContentLoadManager.clear(); }
public override void Exit(Scene nextScene) { SoundManager.StopMusic(); foreach (Player player in Space394Game.GameInstance.Controllers) { player.CurrentState = new MenuPlayerState(player); } SceneObjects.Clear(); base.Exit(nextScene); }
public override void onAddToScene(Scene scene) { if (scene is GameScene) { ((GameScene)scene).addSpawnShip(this); ((GameScene)scene).spawnPointIncrease(ShipTeam); int count = shipPieces.Count; Vector3 shipPos = Position; if (shipPiecePositions.Count() > 0) { for (int i = 0; i < count; i++) { shipPieces[i].Active = true; ((GameScene)scene).CollisionManager.addToCollisionList(shipPieces[i].CollisionBase); shipPieces[i].PiecePosition = shipPos + Vector3.Transform(shipPiecePositions[i], shipPieces[i].Rotation); } } else // Create them from the meshes { SpawnShipPiece tmpPiece; for (int i = 0; i < count; i++) { tmpPiece = shipPieces[i]; tmpPiece.Active = true; ((GameScene)scene).CollisionManager.addToCollisionList(tmpPiece.CollisionBase); tmpPiece.PiecePosition = shipPos + Vector3.Transform(tmpPiece.Position, tmpPiece.Rotation); } } count = LocalNodes.Count; if(ShipTeam == Team.Esxolus) { for (int i = 0; i < count; i++) { ((GameScene)scene).EsxolusCapitalNodes.Add(LocalNodes[i]); } } else { for (int i = 0; i < count; i++) { ((GameScene)scene).HalkCapitalNodes.Add(LocalNodes[i]); } } for (int i = 0; i < ASSAULT_FIGHTERS; i++) { ((GameScene)scene).assaultFightersIncrease(ShipTeam); } for (int i = 0; i < BOMBERS; i++) { ((GameScene)scene).bombersIncrease(ShipTeam); } for (int i = 0; i < INTERCEPTORS; i++) { ((GameScene)scene).interceptorsIncrease(ShipTeam); } } else { } base.onAddToScene(scene); }
public override void onAddToScene(Scene scene) { base.onAddToScene(scene); }
private void switchScene() { Scene nextScene = null; switch (nextSceneEnum) { case sceneEnum.CreditsScene: nextScene = new CreditsScene(); break; case sceneEnum.GameScene: nextScene = new GameScene(); break; case sceneEnum.LoadingScene: nextScene = new LoadingScene(); break; case sceneEnum.LobbyScene: nextScene = new LobbyScene(); break; case sceneEnum.LogoScene: nextScene = new LogoScene(); break; case sceneEnum.MainMenuScene: nextScene = new MainMenuScene(); break; case sceneEnum.MissionSelectScene: nextScene = new MissionSelectScene(); break; case sceneEnum.OptionsScene: nextScene = new OptionsScene(); break; case sceneEnum.PlayerSelectScene: nextScene = new PlayerSelectScene(); break; case sceneEnum.StartScene: nextScene = new StartScene(); break; } if (currentScene != null) { currentScene.Exit(nextScene); } else { } currentScene = nextScene; currentSceneEnum = nextSceneEnum; currentScene.Initialize(); currentState = state.enteringScene; foreach (Player player in localPlayers) { player.setPlayerCamera(currentScene); updatePlayerCameras(); } }
public override void onAddToScene(Scene scene) { trailGenerator.clearLists(); base.onAddToScene(scene); }
public override void Exit(Scene nextScene) { nextScene.handSceneObjects(SceneObjects); SoundManager.StopMusic(); foreach (SceneObject so in SceneObjects.Values) { if (so.CollisionBase != null && so.Active) { ((GameScene)nextScene).CollisionManager.addToCollisionList(so.CollisionBase); } else { } } }