/// <summary> /// Trigger to start playing the intro sequence /// </summary> public void StartIntro() { switch (_myPhase) { case JetManagerPhaseState.PAUSED: _myPhase = JetManagerPhaseState.INTRO1; break; } }
/// <summary> /// Handles the second part of the introduction /// </summary> private void IntroPart2() { //Handles moving the jets above the screen and having //them enter the battlefield from the top _myJets[0].Velocity = new Vector2(0, 1); _myJets[1].Velocity = new Vector2(0, 1); if (_myJets[0].Position.Y > 150 || _myJets[1].Position.Y > 150) { _myJets[0].Velocity = Vector2.Zero; _myJets[1].Velocity = Vector2.Zero; _myPhase = JetManagerPhaseState.FIGHT; AssignNewPattern(); _myJets[0].StopIntro(); _myJets[1].StopIntro(); } }
/// <summary> /// Makes a shiny new Jet Manager /// </summary> /// <param name="id">The factory id on the label of the Jet Manager</param> /// <param name="content">The content manager to use</param> /// <param name="position">The "position" to "spawn" at</param> public TwinJetManager(uint id, ContentManager content, Vector2 position) : base(id) { //Getting and setting the size of the screen screenSize = new Vector2(ScrollingShooterGame.Game.GraphicsDevice.Viewport.Width, ScrollingShooterGame.Game.GraphicsDevice.Viewport.Height); //Set the time to get a new pattern _timerToNewPattern = 0; //Setting up the phases _myPhase = JetManagerPhaseState.PAUSED; _myPattern = JetManagerFlightPattern.PATTERN1; //Creating the patterns _flightPatterns[(int)JetManagerFlightPattern.PATTERN1] = new BossFlightPattern(new Vector2(screenSize.X / 2 - jetSize.X / 2, 300)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(jetSize.X, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(screenSize.X - jetSize.X, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(screenSize.X - jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2] = new BossFlightPattern(new Vector2(jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X / 2 - jetSize.X / 2, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X - jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X / 2 - jetSize.X / 2, screenSize.Y / 2 - jetSize.Y / 2 - 100)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3] = new BossFlightPattern(new Vector2(jetSize.X, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X / 2 - jetSize.X / 2, screenSize.Y - jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X - jetSize.X, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X / 2 - jetSize.X / 2, screenSize.Y - jetSize.Y)); //Creating the Jets _myJets[0] = (TwinJet)ScrollingShooterGame.GameObjectManager.CreateEnemy(EnemyType.TwinJet, new Vector2(-30, 510)); _myJets[1] = (TwinJet)ScrollingShooterGame.GameObjectManager.CreateEnemy(EnemyType.TwinJet, new Vector2(830, 510)); //Start the intro StartIntro(); }
/// <summary> /// Handles the first part of the introduction /// </summary> private void IntroPart1() { //Each jet starts at a bottom corner and flys up to the opposite upper //corner before going to the second part of the intro _myJets[0].Velocity = new Vector2(screenSize.X, 0) - _myJets[0].Position; _myJets[1].Velocity = new Vector2(0, 0) - _myJets[1].Position; if (_myJets[0].Position.X > 800 && _myJets[0].Position.Y < 0) { _myJets[0].Velocity = Vector2.Zero; _myJets[0].Position = new Vector2(600, -50); } if (_myJets[1].Position.X < 0 && _myJets[1].Position.Y < 0) { _myJets[1].Velocity = new Vector2(0, 0); _myJets[1].Position = new Vector2(400, -50); } if (_myJets[0].Position.Y == -50 && _myJets[1].Position.Y == -50) { _myPhase = JetManagerPhaseState.INTRO2; } }
/// <summary> /// Handles the first part of the introduction /// </summary> private void IntroPart1() { //Each jet starts at a bottom corner and flys up to the opposite upper //corner before going to the second part of the intro _myJets[0].Velocity = new Vector2(screenSize.X, 0) - _myJets[0].Position; _myJets[1].Velocity = new Vector2(0, 0) - _myJets[1].Position; if (_myJets[0].Position.X > 800 && _myJets[0].Position.Y < 0) { _myJets[0].Velocity = Vector2.Zero; _myJets[0].Position = new Vector2(600, -50); } if (_myJets[1].Position.X < 0 && _myJets[1].Position.Y < 0) { _myJets[1].Velocity = new Vector2(0,0); _myJets[1].Position = new Vector2(400, -50); } if (_myJets[0].Position.Y == -50 && _myJets[1].Position.Y == -50) { _myPhase = JetManagerPhaseState.INTRO2; } }
/// <summary> /// Makes a shiny new Jet Manager /// </summary> /// <param name="id">The factory id on the label of the Jet Manager</param> /// <param name="content">The content manager to use</param> /// <param name="position">The "position" to "spawn" at</param> public TwinJetManager(uint id, ContentManager content, Vector2 position) : base(id) { //Getting and setting the size of the screen screenSize = new Vector2(ScrollingShooterGame.Game.GraphicsDevice.Viewport.Width, ScrollingShooterGame.Game.GraphicsDevice.Viewport.Height); //Set the time to get a new pattern _timerToNewPattern = 0; //Setting up the phases _myPhase = JetManagerPhaseState.PAUSED; _myPattern = JetManagerFlightPattern.PATTERN1; //Creating the patterns _flightPatterns[(int)JetManagerFlightPattern.PATTERN1] = new BossFlightPattern(new Vector2(screenSize.X/2 - jetSize.X/2, 300)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(jetSize.X, screenSize.Y/2 - jetSize.Y/2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(screenSize.X - jetSize.X, screenSize.Y/2 - jetSize.Y/2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN1].Add(new Vector2(screenSize.X - jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2] = new BossFlightPattern(new Vector2(jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X/2 - jetSize.X/2, screenSize.Y/2 - jetSize.Y/2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X - jetSize.X, jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN2].Add(new Vector2(screenSize.X/2 - jetSize.X/2, screenSize.Y/2 - jetSize.Y/2 - 100)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3] = new BossFlightPattern(new Vector2(jetSize.X, screenSize.Y / 2 - jetSize.Y / 2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X/2 - jetSize.X/2, screenSize.Y - jetSize.Y)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X - jetSize.X, screenSize.Y/2 - jetSize.Y/2)); _flightPatterns[(int)JetManagerFlightPattern.PATTERN3].Add(new Vector2(screenSize.X/2 - jetSize.X/2, screenSize.Y - jetSize.Y)); //Creating the Jets _myJets[0] = (TwinJet)ScrollingShooterGame.GameObjectManager.CreateEnemy(EnemyType.TwinJet, new Vector2(-30, 510)); _myJets[1] = (TwinJet)ScrollingShooterGame.GameObjectManager.CreateEnemy(EnemyType.TwinJet, new Vector2(830, 510)); //Start the intro StartIntro(); }