public override void Initialize() { Texture = playerShipTexture; DrawLayer = .4f; scriptManager = thisScene.scriptManager; bullets = new List <Bullet>(); Origin = new Vector2(23.5f, 23.5f); Hitbox = new Circle(Center, 20f); UsesInnerHitbox = true; InnerHitbox = new Circle(new Vector2(23.5f, 19.5f), 4f); mainEmitter = new BulletEmitter(this, Center, false); mainEmitter.LockedToParentPosition = true; CollidesWithLayers = new int[] { 0, 1 }; CollisionLayer = 3; Color = Color.White; CanFire = thisScene.PlayerCanFire; OnOuterCollision += ObjectGrazed; OnInnerCollision += ObjectCollidedWith; base.Initialize(); }
public IEnumerator<float> FirstKomodo(GameObject go) { go.Rotation = (float)Math.PI / 2f; go.Velocity = 35f; yield return 1.5f; go.LerpVelocity(0f, 1.5f); yield return 1.5f; BulletEmitter emitter = new BulletEmitter(go, go.Center); while (true) { int shots = 0; while(shots < 10) { shots++; emitter.Rotation += .2f; AudioManager.PlaySoundEffect(GameScene.Shot8Sound, .7f, .5f); foreach(Bullet b in emitter.FireBulletExplosion(20, 200f, Color.DeepSkyBlue)) { b.LerpVelocity(40f, 4f); } yield return .2f; } yield return 4f; } }
public IEnumerator<float> HeavyTortoise(GameObject go) { Enemy e = (Enemy)go; e.Rotation = (float)Math.PI / 2f * 3f; e.Health = 25f; e.LerpVelocity(65f, 8f); e.LerpRotation(e.Rotation + VectorMathHelper.GetAngleTo(e.Center, manager.thisScene.player.InnerHitbox.Center) / 2f, 12f); yield return 1.5f; BulletEmitter mainEmitter = new BulletEmitter(e, e.Center, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = Vector2.Zero; yield return .01f; while(true) { int shots = 0; while (shots < 20) { if(manager.thisScene.PointOnScreen(go.Center)) AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .25f); mainEmitter.FireBulletCluster(VectorMathHelper.GetAngleTo(mainEmitter.Center, manager.thisScene.player.InnerHitbox.Center), 1, 10f, 150f, 0f, Color.DeepSkyBlue); shots++; yield return .06f; } yield return 1.73f; } }
public override void Initialize() { Health = 10; Texture = tortoiseTexture; Color = Color.White; DrawLayer = .3f; CollisionLayer = 1; CollidesWithLayers = new int[] { 2 }; Origin = new Vector2(24.5f, 24.5f); Hitbox = new Circle(Center, 12f); CollidesWithLayers = new int[1] { 2 } ; CollidedObjects = new List<GameObject>(); DeletionBoundary = new Vector2(200, 200); mainEmitter = new BulletEmitter(this, Vector2.Zero, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = (Origin / 2); pointValue = 500; scriptManager = thisScene.scriptManager; OnOuterCollision += CollisionHandling; base.Initialize(); base.Initialize(); }
public IEnumerator<float> BombExplosion(GameObject go) { yield return 2f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .9f, 0f); BulletEmitter explosion = new BulletEmitter(this, go.Center, true); explosion.FireBulletExplosion(20, 110f, Color.Lerp(Color.White, Color.Orange, .7f)); explosion.FireBulletExplosion(30, 130f, Color.Lerp(Color.White, Color.Orange, .7f), BulletType.CircleSmall); go.Destroy(); }
public void Explode() { BulletEmitter emitter = new BulletEmitter(this, Center, true); AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .9f, -.2f); foreach (Bullet b in emitter.FireBulletExplosion(100, 250, Color.DarkGreen)) scriptManager.Execute(CrablordBoss.ToxicBulletEffect, b); Destroy(); }
public IEnumerator<float> ClusterBombs(GameObject go) { Bullet thisBullet = (Bullet)go; thisBullet.LerpVelocity(0f, 3f); yield return 3f + (thisBullet.CustomValue1 * .6f); BulletEmitter explosion = new BulletEmitter(this, thisBullet.Center); AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .7f, 0f); AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .7f, 0f); explosion.FireBulletExplosion(6, 160f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f)); explosion.FireBulletCluster(VectorMathHelper.GetAngleTo(thisBullet.Center, thisScene.player.InnerHitbox.Center), 3, 40f, 160f, 40f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f), BulletType.Circle); explosion.FireBulletCluster(VectorMathHelper.GetAngleTo(thisBullet.Center, thisScene.player.InnerHitbox.Center), 4, 50f, 140f, 50f, Color.Lerp(Color.White, Color.DeepSkyBlue, .4f), BulletType.CircleSmall); explosion.Destroy(); thisBullet.Destroy(); }
public IEnumerator<float> BulletFountain(GameObject go) { BulletEmitter thisEmitter = new BulletEmitter(go, go.Center, false); thisEmitter.LockedToParentPosition = true; thisEmitter.LockPositionOffset = Vector2.Zero; yield return go.CustomValue1; float timeToFire = go.CustomValue2; float startTime = manager.thisScene.currentGameTime; while (manager.thisScene.currentGameTime < startTime + timeToFire) { if(manager.thisScene.PointOnScreen(go.Center)) AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .1f, -.3f); thisEmitter.FireBulletCluster(VectorMathHelper.GetAngleTo(go.Center, manager.thisScene.player.InnerHitbox.Center), 1, 10f, (float)Math.Max(100, go.CustomValue3), 0f, Color.DeepSkyBlue); yield return .06f; } }
public void InitializeParts() { arms = new Vector2[6] { new Vector2(31, 22), new Vector2(25, 65), new Vector2(55, 121), new Vector2(224, 22), new Vector2(231, 65), new Vector2(200, 121) }; Hitbox = new Circle(Center, 25f); mainEmitter = new BulletEmitter(this, Center, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = new Vector2(0f, 0f); arm1Emitter = new BulletEmitter(this, Center, false); arm1Emitter.LockedToParentPosition = true; arm1Emitter.LockPositionOffset = arms[0] - Origin; arm2Emitter = new BulletEmitter(this, Center, false); arm2Emitter.LockedToParentPosition = true; arm2Emitter.LockPositionOffset = arms[1] - Origin; arm3Emitter = new BulletEmitter(this, Center, false); arm3Emitter.LockedToParentPosition = true; arm3Emitter.LockPositionOffset = arms[2] - Origin; arm4Emitter = new BulletEmitter(this, Center, false); arm4Emitter.LockedToParentPosition = true; arm4Emitter.LockPositionOffset = arms[3] - Origin; arm5Emitter = new BulletEmitter(this, Center, false); arm5Emitter.LockedToParentPosition = true; arm5Emitter.LockPositionOffset = arms[4] - Origin; arm6Emitter = new BulletEmitter(this, Center, false); arm6Emitter.LockedToParentPosition = true; arm6Emitter.LockPositionOffset = arms[5] - Origin; }
// CustomValue1: Initial wait time // CustomValue2: Number of shots per barrage // CustomValue3: Wait time between shots // CustomValue4: Wait time between barrages public IEnumerator<float> TortoiseBarage(GameObject go) { // Wait custom value 1 seconds yield return go.CustomValue1; BulletEmitter be = new BulletEmitter(go, go.Center); while (true) { int shots = 0; while (shots < go.CustomValue2) { shots++; be.Center = go.Center; be.FireBulletCluster(go.Rotation, 1, 35f, 140f, 40f, Color.DeepSkyBlue); AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .12f); yield return go.CustomValue3; } yield return go.CustomValue4; } }
public IEnumerator<float> Phase3Script(GameObject go) { yield return 2.5f; BulletEmitter mainEmitter2 = new BulletEmitter(this, mainEmitter.Center, false); BulletEmitter mainEmitter3 = new BulletEmitter(this, mainEmitter.Center, false); BulletEmitter mainEmitter4 = new BulletEmitter(this, mainEmitter.Center, false); orbs.Clear(); int cycles = 0; while (true) { // do this for 10 seconds and then wait for 5. float finishTime = currentGameTime + 10f; while (currentGameTime < finishTime) { AudioManager.PlaySoundEffect(GameScene.Shot2Sound, .15f, -.35f); AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .15f, 0f); mainEmitter.Rotation = ((float)Math.PI / 2f) + (((float)Math.PI / 2f) * (float)Math.Sin(currentGameTime * 3f)); mainEmitter.FireBullet(150f, Color.Orange, BulletType.DiamondSmall); mainEmitter2.Rotation = ((float)Math.PI / 2f) + (((float)Math.PI / 2f) * (float)Math.Sin(currentGameTime * 3f) / 1.5f); mainEmitter2.FireBullet(130f, Color.OrangeRed, BulletType.DiamondSmall); mainEmitter3.Rotation = ((float)Math.PI / 2f) + (((float)Math.PI / 2f) * (float)Math.Sin(currentGameTime * 2.5f) / 1.8f); mainEmitter3.FireBullet(120f, Color.Purple, BulletType.DiamondSmall); mainEmitter4.Rotation = mainEmitter.Rotation = ((float)Math.PI / 2f) + (((float)Math.PI / 2f) * (float)Math.Cos(currentGameTime * 1.6f)); mainEmitter4.FireBullet(110f, Color.MediumPurple, BulletType.DiamondSmall); yield return .03f; } cycles++; if (cycles < 4) { yield return 2f; SummonOrb(); foreach (ParasiteOrb po in orbs) scriptManager.Execute(Phase3Orb, po); } yield return 6f; } }
public override void Initialize() { Texture = playerShipTexture; DrawLayer = .4f; scriptManager = thisScene.scriptManager; bullets = new List<Bullet>(); Origin = new Vector2(23.5f, 23.5f); Hitbox = new Circle(Center, 20f); UsesInnerHitbox = true; InnerHitbox = new Circle(new Vector2(23.5f, 19.5f), 4f); mainEmitter = new BulletEmitter(this, Center, false); mainEmitter.LockedToParentPosition = true; CollidesWithLayers = new int[] { 0, 1 }; CollisionLayer = 3; Color = Color.White; CanFire = thisScene.PlayerCanFire; OnOuterCollision += ObjectGrazed; OnInnerCollision += ObjectCollidedWith; base.Initialize(); }
public IEnumerator<float> Phase4Orb(GameObject go) { BulletEmitter thisEmitter = new BulletEmitter(this, go.Center, false); thisEmitter.Rotation = VectorMathHelper.GetAngleTo(thisEmitter.Center, thisScene.player.InnerHitbox.Center); thisEmitter.CustomValue1 = thisEmitter.Rotation; while (true) { yield return 3f; float waveEnd = currentGameTime + 1.8f; while (currentGameTime < waveEnd) { thisEmitter.Center = go.Center; thisEmitter.Rotation = thisEmitter.CustomValue1 + ((float)Math.Sin(currentGameTime * 2f)) / 3f; AudioManager.PlaySoundEffect(GameScene.Shot5Sound, .8f, 0f); Bullet b = thisEmitter.FireBullet(160f, Color.OrangeRed, BulletType.DiamondSmall); b.LerpVelocity(80f, 4f); yield return .06f; } yield return 3f; } }
public void InitializeParts() { mainEmitter = new BulletEmitter(this, Origin, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = Vector2.Zero; ring1 = new Enemy(thisScene, Origin); ring1.Initialize(); ring1.DeletionBoundary = DeletionBoundary; ring1.DrawAtTrueRotation = true; ring1.Color = Color.White; ring1.Origin = Origin; ring1.SetParent(this); ring1.SetTexture(boss5Ring1Texture); ring1.LockedToParentPosition = true; ring1.Center = this.Center; ring1.DrawLayer = .32f; ring2 = new Enemy(thisScene, Origin); ring2.Initialize(); ring2.DeletionBoundary = DeletionBoundary; ring2.DrawAtTrueRotation = true; ring2.Color = Color.White; ring2.Origin = Origin; ring2.SetParent(this); ring2.SetTexture(boss5Ring2Texture); ring2.LockedToParentPosition = true; ring2.Center = this.Center; ring2.DrawLayer = .31f; ring1Emitters = new List<BulletEmitter>() { new BulletEmitter(ring1, new Vector2(130, 175)), new BulletEmitter(ring1, new Vector2(130, 294)), new BulletEmitter(ring1, new Vector2(381, 175)), new BulletEmitter(ring1, new Vector2(381, 294)) }; ring2Emitters = new List<BulletEmitter>() { new BulletEmitter(ring2, new Vector2(195, 110)), new BulletEmitter(ring2, new Vector2(117, 234.5f)), new BulletEmitter(ring2, new Vector2(195, 359)), new BulletEmitter(ring2, new Vector2(316, 110)), new BulletEmitter(ring2, new Vector2(394, 234.5f)), new BulletEmitter(ring2, new Vector2(316, 359)) }; // Setup the ring emitter properties. foreach (BulletEmitter be in ring1Emitters) { be.Center = Center + (be.Center - Origin); be.DeletionBoundary = new Vector2(99999, 99999); be.CustomValue1 = Vector2.Distance(Center, be.Center); be.Rotation = VectorMathHelper.GetAngleTo(Center, be.Center); } // Setup the ring emitter properties. foreach (BulletEmitter be in ring2Emitters) { be.Center = Center + (be.Center - Origin); be.DeletionBoundary = new Vector2(99999, 99999); be.CustomValue1 = Vector2.Distance(Center, be.Center); be.Rotation = VectorMathHelper.GetAngleTo(Center, be.Center); } topLayer = new Enemy(thisScene, Origin); topLayer.Initialize(); topLayer.DeletionBoundary = DeletionBoundary; topLayer.Color = Color.White; topLayer.Origin = Origin; topLayer.SetTexture(boss5TopTexture); topLayer.SetParent(this); topLayer.LockedToParentPosition = true; topLayer.Center = this.Center; topLayer.DrawLayer = .3f; rotatingBullets = new List<Bullet>(); }
// Main script public IEnumerator<float> MainScriptPhase1(GameObject thisShip) { BulletEmitter mainEmitter = new BulletEmitter(this, this.Center, false); mainEmitter.LockedToParentPosition = true; int bossPhase = 1; LerpPosition(new Vector2(300f, 125f), 2f); yield return 3f; Vulnerable = true; bool alive = true; while (alive) { int cycles = 0; while (bossPhase == 1) { int shots = 0; while (shots < 15) { AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, .4f); mainEmitter.FireBulletSpread(((float)Math.PI / 2), 7, 90f, 140f, Color.Lerp(Color.White, Color.Orange, .45f), BulletType.Circle); shots++; yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, .2f); mainEmitter.FireBulletSpread(((float)Math.PI / 2), 6, 70f, 140f, Color.Lerp(Color.White, Color.Orange, .45f), BulletType.Circle); shots++; yield return .25f; } shots = 0; LerpPosition(new Vector2(25, 125), 1.5f); yield return 1.5f; while (shots < 20) { AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .3f, -.6f); mainEmitter.FireBulletSpread(((float)Math.PI / 2 * .6f) + (float)Math.Sin(currentGameTime * 3) / 4, 3, 25f, 220f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); shots++; yield return .06f; } shots = 0; LerpPosition(new Vector2(600, 125), 2.5f); yield return 2.5f; while (shots < 20) { AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .3f, -.6f); mainEmitter.FireBulletSpread(((float)Math.PI / 2 * 1.4f) + (float)Math.Sin(currentGameTime * 3) / 4, 3, 25f, 220f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); shots++; yield return .06f; } LerpPosition(new Vector2(300f, 125f), 1.5f); yield return 2.2f; cycles++; if (cycles > 1) bossPhase++; } subEmitter1 = new BulletEmitter(this, this.Center, false); subEmitter1.LockedToParentPosition = true; subEmitter1.LockPositionOffset = new Vector2(-28f, -10f); subEmitter2 = new BulletEmitter(this, this.Center, false); subEmitter2.LockedToParentPosition = true; subEmitter2.LockPositionOffset = new Vector2(28f, -10f); scriptManager.Execute(Subemitter1Script, subEmitter1); scriptManager.Execute(Subemitter2Script, subEmitter2); scriptManager.Execute(SubemitterFirePhase2, subEmitter1); scriptManager.Execute(SubemitterFirePhase2, subEmitter2); yield return 1f; cycles = 0; while (bossPhase == 2) { AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .5f; LerpPosition(new Vector2(50, 400), 3f); yield return 1.5f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .5f; LerpPosition(new Vector2(550, 400), 3f); yield return 1.5f; LerpPosition(new Vector2(300f, 250f), 2f); AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(15, 100f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .5f; LerpPosition(new Vector2(300f, 125f), 4f); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(15, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(13, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(11, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(15, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(13, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .25f; AudioManager.PlaySoundEffect(GameScene.Shot7Sound, .6f, 0f); mainEmitter.FireBulletExplosion(11, 150f, Color.Lerp(Color.White, Color.DeepSkyBlue, .45f), BulletType.Circle); yield return .5f; cycles++; if (cycles > 2) { bossPhase = 3; } } cycles = 0; subEmitter1.Destroy(); subEmitter2.Destroy(); LerpPosition(new Vector2(300f, 125f), 3.5f); while (bossPhase == 3) { int shots = 0; while (shots < 25) { shots++; AudioManager.PlaySoundEffect(GameScene.Shot3Sound, .5f, -.6f); mainEmitter.FireBulletSpread(VectorMathHelper.GetAngleTo(this.Hitbox.Center, thisScene.player.InnerHitbox.Center), 5, 80f, 200f, Color.Lerp(Color.White, Color.Orange, .4f), BulletType.Circle); yield return .175f; } int i = 1; AudioManager.PlaySoundEffect(GameScene.Shot8Sound, 1f, 0f); foreach (Bullet b in mainEmitter.FireBulletWave(0f, 4, 200f, 50f, Color.Lerp(Color.White, Color.Orange, .3f))) { b.CustomValue1 = i++; scriptManager.Execute(ClusterBombs, b); } i = 1; foreach (Bullet b in mainEmitter.FireBulletWave((float)Math.PI, 4, 200f, 50f, Color.Lerp(Color.White, Color.Orange, .3f))) { b.CustomValue1 = i++; scriptManager.Execute(ClusterBombs, b); } yield return 3.5f; cycles++; if (cycles > 2) { bossPhase = 1; } } } }
public void InitializeParts() { arms = new Vector2[6] { new Vector2(38, 167), new Vector2(77, 155), new Vector2(110, 150), new Vector2(146, 150), new Vector2(179, 155), new Vector2(213, 167) }; Hitbox = new Circle(Center, 50f); mainEmitter = new BulletEmitter(this, Center, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = new Vector2(0f, 43f); arm1Emitter = new BulletEmitter(this, Center, false); arm1Emitter.LockedToParentPosition = true; arm1Emitter.LockPositionOffset = arms[0] - Origin; arm2Emitter = new BulletEmitter(this, Center, false); arm2Emitter.LockedToParentPosition = true; arm2Emitter.LockPositionOffset = arms[1] - Origin; arm3Emitter = new BulletEmitter(this, Center, false); arm3Emitter.LockedToParentPosition = true; arm3Emitter.LockPositionOffset = arms[2] - Origin; arm4Emitter = new BulletEmitter(this, Center, false); arm4Emitter.LockedToParentPosition = true; arm4Emitter.LockPositionOffset = arms[3] - Origin; arm5Emitter = new BulletEmitter(this, Center, false); arm5Emitter.LockedToParentPosition = true; arm5Emitter.LockPositionOffset = arms[4] - Origin; arm6Emitter = new BulletEmitter(this, Center, false); arm6Emitter.LockedToParentPosition = true; arm6Emitter.LockPositionOffset = arms[5] - Origin; }
public IEnumerator<float> MainScriptPhase2(GameObject thisShip) { if(subEmitter1 != null) subEmitter1.Destroy(); if(subEmitter2 != null) subEmitter2.Destroy(); BulletEmitter mainEmitter1 = new BulletEmitter(this, this.Center, false); mainEmitter1.CustomValue1 = 1; // Rotate this emitter counter clockwise mainEmitter1.CustomValue2 = 35; // Rotate at this distance. BulletEmitter mainEmitter2 = new BulletEmitter(this, this.Center, false); mainEmitter2.CustomValue2 = 35f; // This is the distance to orbit. scriptManager.Execute(RotatingEmitters, mainEmitter1); scriptManager.Execute(RotatingEmitters, mainEmitter2); while (true) { LerpPosition(new Vector2(350, 255), 2f); yield return .9f; CustomValue1 = (float)Math.PI / 2f * 3; CustomValue2 = CustomValue1; yield return .075f; int shots = 0; while (shots < 120) { int subshots = 0; while (subshots < 4) { AudioManager.PlaySoundEffect(GameScene.Shot4Sound, .29f, .5f); mainEmitter1.FireBullet(VectorMathHelper.GetAngleTo(this.Center, mainEmitter1.Center), 170f, Color.Lerp(Color.White, Color.DeepSkyBlue, .6f)); mainEmitter2.FireBullet(VectorMathHelper.GetAngleTo(this.Center, mainEmitter2.Center), 170f, Color.Lerp(Color.White, Color.DeepSkyBlue, .6f)); subshots++; shots++; yield return .03f; } subshots = 0; yield return .03f; } LerpPosition(new Vector2(350, 135), 1.5f); shots = 0; // Randomize the rotation CustomValue1 = (float)(new Random().NextDouble() * ((float)Math.PI*2)); CustomValue2 = CustomValue1; while (shots < 10) { AudioManager.PlaySoundEffect(GameScene.Shot1Sound, .8f, -.15f); foreach (Bullet b in (mainEmitter1.FireBulletExplosion(15, 170f, Color.Lerp(Color.White, Color.Orange, .4f)))) { b.LerpVelocity(90f, 3f); } foreach (Bullet b in (mainEmitter2.FireBulletExplosion(15, 190f, Color.Lerp(Color.White, Color.Red, .4f), BulletType.CircleSmall))) { b.LerpVelocity(90f, 3f); } shots++; yield return .15f; } yield return 1.5f; } }
public IEnumerator<float> FirstKomodo(GameObject go) { yield return 2f; BulletEmitter be = new BulletEmitter(go, go.Center); be.LockedToParentPosition = true; be.LockPositionOffset = Vector2.Zero; while(true) { int shots = 0; while (shots < 15) { be.FireBulletSpread(VectorMathHelper.GetAngleTo(go.Center, manager.thisScene.player.InnerHitbox.Center), 5, 70f, 220f, Color.Orange); AudioManager.PlaySoundEffect(GameScene.Shot3Sound, .5f); shots++; yield return .3f; } yield return .5f; go.LerpPosition(new Vector2(500, go.Center.Y), 1.5f); yield return 2f; shots = 0; float turnMod = 1; while (shots < 20) { if (shots > 10) turnMod = -1f; be.FireBulletExplosion(15, 120f, Color.DeepSkyBlue); AudioManager.PlaySoundEffect(GameScene.Shot6Sound, .5f); be.Rotation += .1f * turnMod; shots++; yield return .1f; } yield return .5f; go.LerpPosition(new Vector2(300, go.Center.Y), 1.5f); yield return 2f; } }
public void InitializeParts() { mainEmitter = new BulletEmitter(this, Origin, false); mainEmitter.LockedToParentPosition = true; mainEmitter.LockPositionOffset = Vector2.Zero; leftWingCannon = new BulletEmitter(this, Origin, false); leftWingCannon.LockedToParentPosition = true; leftWingCannon.LockPositionOffset = new Vector2(26, 154) - Origin; leftInnerWingCannon = new BulletEmitter(this, Origin, false); leftInnerWingCannon.LockedToParentPosition = true; leftInnerWingCannon.LockPositionOffset = new Vector2(65.5f, 141) - Origin; rightInnerWingCannon = new BulletEmitter(this, Origin, false); rightInnerWingCannon.LockedToParentPosition = true; rightInnerWingCannon.LockPositionOffset = new Vector2(189.5f, 141) - Origin; rightWingCannon = new BulletEmitter(this, Origin, false); rightWingCannon.LockedToParentPosition = true; rightWingCannon.LockPositionOffset = new Vector2(229, 154) - Origin; mainEmitter.Rotation = (float)(Math.PI / 2f); leftWingCannon.Rotation = (float)(Math.PI / 2f); leftInnerWingCannon.Rotation = (float)(Math.PI / 2f); rightInnerWingCannon.Rotation = (float)(Math.PI / 2f); rightWingCannon.Rotation = (float)(Math.PI / 2f); }