public void checkkillBullet(WaveManager wm) { for (int i = 0; i < wm.WaveEnemies.Count;) { if (wm.WaveEnemies[i].alive == true) { this.Move(wm.WaveEnemies[i]); if (Position.X > wm.WaveEnemies[i].Position.X + 600) { this.alive = false; } if (Position.X < wm.WaveEnemies[i].Position.X - 600) { this.alive = false; } if (this.BoundingBox.Intersects(wm.WaveEnemies[i].BoundingBox)) { wm.WaveEnemies[i].alive = false; this.alive = false; } } else{ i++; } } }
public void Draw(SpriteBatch spriteBatch, VIP vip,WaveManager wm,Crosshair cross) { if (HudUpg == HudUpgradeState.stoneAge) { spriteBatch.Draw(pit, Position, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.1f); } else if (HudUpg == HudUpgradeState.modernAge) { spriteBatch.Draw(pit3, Position, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.1f); } else if (HudUpg == HudUpgradeState.nanoAge) { spriteBatch.Draw(pit2, Position, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0.1f); } spriteBatch.DrawString(health, "Wave:" + wm.waveNumber , new Vector2(this.Position.X+30, this.Position.Y+ 60), Color.Green,0f,Vector2.Zero,2f,SpriteEffects.None,0f); if(wm.waveNumber>=3){ spriteBatch.DrawString(health, "Missile : " + Missile , new Vector2(this.Position.X + 400, this.Position.Y + 450), Color.Green, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); } spriteBatch.DrawString(health, "Bullets : " + bullet , new Vector2(this.Position.X + 210, this.Position.Y + 450), Color.Green, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); spriteBatch.DrawString(health, "HEALTH :" + vip.health, new Vector2(this.Position.X + 40, this.Position.Y + 20), Color.Green, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); spriteBatch.DrawString(health, "Score :" + score, new Vector2(this.Position.X + 30, this.Position.Y + 120), Color.Green, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); if(this.BoundingBox.Intersects(vip.BoundingBox)){ } else if (vip.Position.Y < cross.Position.Y) { spriteBatch.Draw(arrowUP, new Vector2(this.Position.X + 70, this.Position.Y + 200), null, Color.White, 0f, Vector2.Zero, .33f, SpriteEffects.None, 0f); } else if(vip.Position.Y>cross.Position.Y) { spriteBatch.Draw(arrowDown, new Vector2(this.Position.X + 70, this.Position.Y + 200), null, Color.White, 0f, Vector2.Zero, .33f, SpriteEffects.None, 0f); } if (vip.health <= 0.0f) { spriteBatch.DrawString(gameover, "GAME OVER ", new Vector2(this.Position.X + 220, this.Position.Y + 440), Color.Gold); } }
public void checkEnemys(WaveManager wm) { if (state == MissileUpgradeState.HalfSize) { if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBoxHalf.Intersects(wm.para1.BoundingBox)) { wm.para1.alive = false; } } if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBoxHalf.Intersects(wm.para1.BoundingBoxNoPara)) { wm.para1.alive = false; } } if (this.alive == true && this.BoundingBoxHalf.Intersects(wm.j1.boundingbox)) { wm.j1.alive = false; } if (this.alive == true && this.BoundingBoxHalf.Intersects(wm.j2.boundingbox)) { wm.j2.alive = false; } foreach (EvilChopper e in wm.WaveEnemies) { if (this.alive == true) { if (e.BoundingBox.Intersects(this.BoundingBoxHalf)) { e.alive = false; } } } } if (state == MissileUpgradeState.Upgraded) { if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBoxTwice.Intersects(wm.para1.BoundingBox)) { wm.para1.alive = false; } } if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBoxTwice.Intersects(wm.para1.BoundingBoxNoPara)) { wm.para1.alive = false; } } if (this.alive == true && this.BoundingBoxTwice.Intersects(wm.j1.boundingbox)) { wm.j1.alive = false; } if (this.alive == true && this.BoundingBoxTwice.Intersects(wm.j2.boundingbox)) { wm.j2.alive = false; } foreach (EvilChopper e in wm.WaveEnemies) { if (this.alive == true) { if (e.BoundingBox.Intersects(this.BoundingBoxTwice)) { e.alive = false; } } } } if (state == MissileUpgradeState.Normal) { if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBox.Intersects(wm.para1.BoundingBox)) { wm.para1.alive = false; } } if (wm.para1.otherBox == false) { if (this.alive == true && this.BoundingBox.Intersects(wm.para1.BoundingBoxNoPara)) { wm.para1.alive = false; } } if (this.alive == true && this.BoundingBox.Intersects(wm.j1.boundingbox)) { wm.j1.alive = false; } if (this.alive == true && this.BoundingBox.Intersects(wm.j2.boundingbox)) { wm.j2.alive = false; } foreach (EvilChopper e in wm.WaveEnemies) { if (this.alive == true) { if (e.BoundingBox.Intersects(this.BoundingBox)) { e.alive = false; } } } } }
public void Update(Crosshair crosshair, HUD h1, WaveManager wm, DropBoxManager dbm) { medalstrue1 = medalstrue; medals1 = medals; #region MissileUpgrades if (crosshair.amountMissileShot == 5) {if(i==0){ missileUpgrade.Play(); missileOverTrans -= .05f; crosshair.missile.state = MissileUpgradeState.Normal; i = 1; } } if (crosshair.amountMissileShot == 20) { if (i == 1) { missileUpgrade.Play(); missileOverTrans -= .05f; crosshair.missile.state = MissileUpgradeState.Upgraded; if (missileOverTrans < -2f) { transparency = 1f; i = 2; } } } #endregion #region CrossHairPowerUpgraded if (crosshair.amountShot == 10) { if (i == 2) { upgrade.Play(); overlayAlive = true; transparency -= .05f; crosshair.power = CrossHairPowerState.SixHitKill; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 3; } } } if (crosshair.amountShot == 20) { if (i == 3) { upgrade.Play(); overlayAlive = true; transparency -= .05f; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 4; } crosshair.power = CrossHairPowerState.FiveHitKill; } } if (crosshair.amountShot == 30) { if (i == 4) { upgrade.Play(); overlayAlive = true; transparency -= .05f; crosshair.power = CrossHairPowerState.FourHitKill; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 5; } } } if (crosshair.amountShot == 40) { if (i == 5) { upgrade.Play(); overlayAlive = true; transparency -= .05f; crosshair.power = CrossHairPowerState.ThreeHitKill; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 6; } } } if (crosshair.amountShot == 50) { if (i == 6) { upgrade.Play(); overlayAlive = true; transparency -= .05f; crosshair.power = CrossHairPowerState.TwoHitKill; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 7; } } } if (crosshair.amountShot == 70) { if (i == 7) { upgrade.Play(); overlayAlive = true; transparency -= .02f; crosshair.power = CrossHairPowerState.OneHitKill; if (transparency < -2f) { overlayAlive = false; transparency = 1f; i = 8; } } } #endregion #region CrosshairSizeUpgraded if (wm.waveNumber == 2 && wm.WaveEnemies.Count == 0) { upgrade.Play(); overlayAlive = true; transparency -= .05f; if (transparency < -2f) { overlayAlive = false; transparency = 1f; } crosshair.size = CrossHairSizeState.OneAndAHalfBigger; } if (wm.waveNumber == 12 && wm.WaveEnemies.Count == 0) { upgrade.Play(); overlayAlive = true; transparency -= .05f; if (transparency < -2f) { overlayAlive = false; transparency = 1f; } crosshair.size = CrossHairSizeState.TwoTimes; } #endregion #region RankAssignment if (crosshair.totalKilled >= 2&&crosshair.totalKilled<7) { if (Once == 0) { lvlUp.Play(); RankOfYourGuy = Rank.Specialist; h1.score += 100000; Once=1; } } if (crosshair.totalKilled >= 7 && crosshair.totalKilled < 17) { if (Once == 1) { lvlUp.Play(); RankOfYourGuy = Rank.Corporal; h1.score += 175000; Once=2; } } if (crosshair.totalKilled >= 17 && crosshair.totalKilled < 30) { if (Once == 2){ lvlUp.Play(); RankOfYourGuy = Rank.Sergeant; h1.score += 75000; Once = 3; } } if (crosshair.totalKilled >= 30 && crosshair.totalKilled < 34) { if (Once == 3) { lvlUp.Play(); RankOfYourGuy = Rank.StaffSergeant; h1.score += 40000; Once = 4; } } if (crosshair.totalKilled >= 34 && crosshair.totalKilled < 45) { if (Once == 4) { lvlUp.Play(); RankOfYourGuy = Rank.SergeantFirstClass; h1.score += 40000; Once = 5; } } if (crosshair.totalKilled >= 45 && crosshair.totalKilled < 55) { if (Once == 5) { lvlUp.Play(); RankOfYourGuy = Rank.MasterSergeant; h1.score += 40000; Once = 6; } } if (crosshair.totalKilled >= 55 && crosshair.totalKilled < 67) { if (Once == 6) { lvlUp.Play(); RankOfYourGuy = Rank.FirstSergeant; h1.score += 40000; Once = 7; } } if (crosshair.totalKilled >= 67 && crosshair.totalKilled < 80) { if (Once == 7) { lvlUp.Play(); RankOfYourGuy = Rank.SergeantMajor; h1.score += 40000; Once=8; } } if (crosshair.totalKilled >= 80 && crosshair.totalKilled < 100) { if (Once == 8) { lvlUp.Play(); RankOfYourGuy = Rank.CommandSergeantMajor; h1.score += 25000; Once=9; } } if (crosshair.totalKilled >= 100 && crosshair.totalKilled < 122) { if (Once == 9) { lvlUp.Play(); RankOfYourGuy = Rank.SecondLieutenant; h1.score += 25000; Once=10; } } if (crosshair.totalKilled >= 122 && crosshair.totalKilled < 143) { if (Once == 10) { lvlUp.Play(); RankOfYourGuy = Rank.FirstLieutenant; h1.score += 25000; Once=11; } } if (crosshair.totalKilled >= 143 && crosshair.totalKilled < 162) { if (Once == 11) { lvlUp.Play(); RankOfYourGuy = Rank.Captain; h1.score += 25000; Once=12; } } if (crosshair.totalKilled >= 162 && crosshair.totalKilled < 186) { if (Once == 12) { lvlUp.Play(); RankOfYourGuy = Rank.Major; h1.score += 25000; Once=13; } } if (crosshair.totalKilled >= 186 && crosshair.totalKilled < 206) { if (Once == 13) { lvlUp.Play(); RankOfYourGuy = Rank.LieutenantColonel; h1.score += 25000; Once=14; } } if (crosshair.totalKilled >= 206 && crosshair.totalKilled < 230) { if (Once == 14) { lvlUp.Play(); RankOfYourGuy = Rank.Colonel; h1.score += 25000; Once=15; } } if (crosshair.totalKilled >= 230 && crosshair.totalKilled < 260) { if (Once == 15) { lvlUp.Play(); RankOfYourGuy = Rank.ColonelFirstClass; h1.score += 25000; Once=16; } } if (crosshair.totalKilled >= 260 && crosshair.totalKilled < 291) { if (Once == 16) { lvlUp.Play(); RankOfYourGuy = Rank.BrigadierGeneral; h1.score += 25000; Once=17; } } if (crosshair.totalKilled >= 291 &&crosshair.totalKilled < 320) { if (Once == 17) { lvlUp.Play(); RankOfYourGuy = Rank.BrigadierGeneralFirstClass; h1.score += 25000; Once=18; } } if (crosshair.totalKilled >= 320&&crosshair.totalKilled<329) { if (Once == 18) { lvlUp.Play(); RankOfYourGuy = Rank.LieutenantGeneral; h1.score += 25000; Once=19; } } if (crosshair.totalKilled >= 329 && crosshair.totalKilled < 354) { if (Once == 19) { lvlUp.Play(); RankOfYourGuy = Rank.General; h1.score += 25000; Once=20; } } if (crosshair.totalKilled >= 354 && crosshair.totalKilled < 378) { if (Once == 20) { lvlUp.Play(); RankOfYourGuy = Rank.MajorGeneral; h1.score += 25000; Once=21; } } if (crosshair.totalKilled >= 378 && crosshair.totalKilled < 400) { if (Once == 21) { lvlUp.Play(); RankOfYourGuy = Rank.MajorGeneralFirstClass; h1.score += 25000; Once=22; } } if (crosshair.totalKilled >= 400) { if (Once == 22) { lvlUp.Play(); RankOfYourGuy = Rank.ChopperCommander; h1.score = 990000; Once=23; } } #endregion #region Medals if (dbm.DropBoxesHit > 1) { medalstrue[0] = true; } if (dbm.DropBoxesHit > 3) { medalstrue[1] = true; } if (dbm.DropBoxesHit > 5) { medalstrue[2] = true; } if (crosshair.amountShot > 50) { medalstrue[4] = true; } if (crosshair.amountShot > 75) { medalstrue[5] = true; } if (crosshair.amountShot > 100) { medalstrue[6] = true; } if (wm.choppersKilled > 20) { medalstrue[7] = true; } if (wm.choppersKilled > 60) { medalstrue[8] = true; } if (wm.choppersKilled > 100) { medalstrue[9] = true; } if (crosshair.amountMissileShot > 20) { medalstrue[10] = true; } if (crosshair.amountMissileShot > 40) { medalstrue[11] = true; } if (crosshair.amountMissileShot > 60) { medalstrue[12] = true; } if (wm.paratroopersKilled > 1) { medalstrue[13] = true; } if (wm.paratroopersKilled > 2) { medalstrue[14] = true; } if (wm.paratroopersKilled > 3) { medalstrue[15] = true; } if (wm.jetsKilled > 1) { medalstrue[16] = true; } if (wm.jetsKilled > 3) { medalstrue[17] = true; } if (wm.jetsKilled > 5) { medalstrue[18] = true; } #endregion #region HudUpgrades if(h1.score >= 150000 && h1.score <500000) { h1.HudUpg = HudUpgradeState.modernAge; } else if (h1.score >= 500000 && h1.score <= 999999) { h1.HudUpg = HudUpgradeState.nanoAge; } else { h1.HudUpg = HudUpgradeState.stoneAge; } #endregion }
public void Update(WaveManager wm,HUD h1,background b1, DropBoxManager dbm, VIP vip) { missile.update(this); Move( h1); sound.Play(); missile.checkEnemys(wm); #region PowerAssignment if (power == CrossHairPowerState.SevenHitKill) { strength = 1; } if (power == CrossHairPowerState.SixHitKill) { strength = 1.5f; } if (power == CrossHairPowerState.FiveHitKill) { strength = 2.0f; } if (power == CrossHairPowerState.FourHitKill) { strength = 2.5f; } if (power == CrossHairPowerState.ThreeHitKill) { strength = 3.0f; } if (power == CrossHairPowerState.TwoHitKill) { strength = 3.5f; } if (power == CrossHairPowerState.OneHitKill) { strength = 7.0f; } #endregion // accelerometer.ReadingChanged += new EventHandler<AccelerometerReadingEventArgs>(AccelerometerReadingChanged); if (TouchPanel.IsGestureAvailable) { GestureSample touch = TouchPanel.ReadGesture(); if (touch.Delta.Y < 0) { Velocity.Y =-7f; } if (touch.Delta.Y < 0&&touch.Delta.X<0) { Velocity.Y= -7f; Velocity.X = -7f; } if (touch.Delta.Y > 0 && touch.Delta.X > 0) { Velocity.Y =-7f; Velocity.X = 7f; } if (touch.Delta.Y > 0 && touch.Delta.X < 0) { Velocity.Y = 7f; Velocity.X =-7f; } if (touch.Delta.Y < 0 && touch.Delta.X > 0) { Velocity.Y = -7f; Velocity.X = 7f; } if (touch.Delta.Y > 0) { Velocity.Y = 7f; } if (touch.Delta.X < 0) { Velocity.X = -7f; } if (touch.Delta.X > 0) { Velocity.X = 7f; } if (touch.GestureType == GestureType.Tap) { if (h1.bullet > 0) { amountShot += 1; if (dbm.IAdb.active == false) { h1.bullet = h1.bullet - 1; } fired = true; h1.firedTimer = 0; bulletSound.Play(); //fire bullet; } } if (wm.waveNumber >= 3) { if (touch.GestureType == GestureType.Hold) { if (h1.Missile > 0) { amountMissileShot += 1; if (dbm.IAdb.active == false) { h1.Missile = h1.Missile - 1; } fired = true; explode.Play(); h1.firedTimer = 0; missile.alive = true; } //fire bullet; } } } /*if (accelReading.Z < -.7f) { Velocity.Y = -5f; } if (accelReading.Z > -.35f) { Velocity.Y = 5f; } if (accelReading.X < -.3f) { // Velocity.Y += 1f; } if (accelReading.X > .3f) { // Velocity.Y -= .2f; } if (accelReading.Y < -.2f) { Velocity.X = -5f; } if (accelReading.Y > .2f) { Velocity.X = 5f; }*/ #region Clamping if (this.Position.X < 400) { this.Position.X = (400); Velocity.X = 0; } if (this.Position.Y < b1.b[0].position.Y+(h1.pit.Height/2)) { this.Position.Y = b1.b[0].position.Y+(h1.pit.Height / 2); Velocity.Y = 0; } if (this.Position.X > 2200 - (h1.pit.Width)) { this.Position.X = 2200 - h1.pit.Width; Velocity.X = -1; } if (this.Position.Y > 2000 - (h1.pit.Height / 2)) { this.Position.Y = 2000 - (h1.pit.Height / 2); Velocity.Y = -1; } #endregion #region DropboxShootingBasedOnCrosshairSize if (size == CrossHairSizeState.Original) { if (dbm.db.alive == true && fired == true && dbm.db.BoundingBox.Intersects(this.BoundingBox)) { dbm.db.alive = false; if (dbm.db.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.db.Position = new Vector2(600, 0); dbm.db.Velocity = new Vector2(0, 0); dbm.timing = 0f; reload.Play(); dbm.db.giveBullets(h1); dbm.db.giveMissles(h1); dbm.ok = 0; vip.health += 33.3f; } } if (dbm.IAdb.alive == true && fired == true && dbm.IAdb.BoundingBox.Intersects(this.BoundingBox)) { dbm.IAdb.active = true; dbm.IAdb.countdown = -1.0f; dbm.IAdb.alive = false; if (dbm.IAdb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.IAdb.Position = new Vector2(600, 0); dbm.IAdb.Velocity = new Vector2(0, 0); dbm.IAdbTiming = 0f; //dbm.IAdb.infinityTIME = InfinityState.Alive; reload.Play(); dbm.ok = 0; } } if (dbm.InvDb.alive == true && fired == true && dbm.InvDb.BoundingBox.Intersects(this.BoundingBox)) { dbm.InvDb.active = true; dbm.InvDb.countdown = -1.0f; dbm.InvDb.alive = false; if (dbm.InvDb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.InvDb.Position = new Vector2(600, 0); dbm.InvDb.Velocity = new Vector2(0, 0); dbm.InvTiming = 0f; //dbm.IAdb.infinityTIME = InfinityState.Alive; reload.Play(); dbm.ok = 0; } } } if (size == CrossHairSizeState.OneAndAHalfBigger) { if (dbm.db.alive == true && fired == true && dbm.db.BoundingBox.Intersects(this.BoundingBox1point5)) { dbm.db.alive = false; if (dbm.db.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.db.Position = new Vector2(600, 0); dbm.db.Velocity = new Vector2(0, 0); dbm.timing = 0f; reload.Play(); dbm.db.giveBullets(h1); dbm.db.giveMissles(h1); dbm.ok = 0; vip.health += 33.3f; } } if (dbm.IAdb.alive == true && fired == true && dbm.IAdb.BoundingBox.Intersects(this.BoundingBox1point5)) { dbm.IAdb.active = true; dbm.IAdb.alive = false; if (dbm.IAdb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.IAdb.Position = new Vector2(600, 0); dbm.IAdb.Velocity = new Vector2(0, 0); dbm.IAdbTiming = 0f; reload.Play(); //dbm.IAdb.infinityTIME = InfinityState.Alive; dbm.ok = 0; } } if (dbm.InvDb.alive == true && fired == true && dbm.InvDb.BoundingBox.Intersects(this.BoundingBox)) { dbm.InvDb.active = true; dbm.InvDb.countdown = -1.0f; dbm.InvDb.alive = false; if (dbm.InvDb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.InvDb.Position = new Vector2(600, 0); dbm.InvDb.Velocity = new Vector2(0, 0); dbm.InvTiming = 0f; //dbm.IAdb.infinityTIME = InfinityState.Alive; reload.Play(); dbm.ok = 0; } } } if (size == CrossHairSizeState.TwoTimes) { if (dbm.db.alive == true && fired == true && dbm.db.BoundingBox.Intersects(this.BoundingBox2)) { dbm.db.alive = false; if (dbm.db.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.db.Position = new Vector2(600, 0); dbm.db.Velocity = new Vector2(0, 0); dbm.timing = 0f; reload.Play(); dbm.db.giveBullets(h1); dbm.db.giveMissles(h1); dbm.ok = 0; vip.health += 33.3f; } } if (dbm.IAdb.alive == true && fired == true && dbm.IAdb.BoundingBox.Intersects(this.BoundingBox2)) { dbm.IAdb.active = true; dbm.IAdb.alive = false; if (dbm.IAdb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.IAdb.Position = new Vector2(600, 0); dbm.IAdb.Velocity = new Vector2(0, 0); dbm.IAdbTiming = 0f; reload.Play(); //dbm.IAdb.infinityTIME = InfinityState.Alive; dbm.ok = 0; } } if (dbm.InvDb.alive == true && fired == true && dbm.InvDb.BoundingBox.Intersects(this.BoundingBox)) { dbm.InvDb.active = true; dbm.InvDb.countdown = -1.0f; dbm.InvDb.alive = false; if (dbm.InvDb.boom.transparency < -2f) { dbm.DropBoxesHit += 1; dbm.InvDb.Position = new Vector2(600, 0); dbm.InvDb.Velocity = new Vector2(0, 0); dbm.InvTiming = 0f; //dbm.IAdb.infinityTIME = InfinityState.Alive; reload.Play(); dbm.ok = 0; } } } #endregion #region ParatrooperDyingBasedOnCrossSize if (size == CrossHairSizeState.Original) { if (wm.para1.otherBox == false) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBox.Intersects(this.BoundingBox)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; } } if (wm.para1.otherBox == true) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBoxNoPara.Intersects(this.BoundingBox)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; wm.para1.otherBox = false; } } } if (size == CrossHairSizeState.OneAndAHalfBigger) { if (wm.para1.otherBox == false) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBox.Intersects(this.BoundingBox1point5)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; } } if (wm.para1.otherBox == true) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBoxNoPara.Intersects(this.BoundingBox1point5)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; wm.para1.otherBox = false; } } } if (size == CrossHairSizeState.TwoTimes) { if (wm.para1.otherBox == false) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBox.Intersects(this.BoundingBox2)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; } } if (wm.para1.otherBox == true) { if (wm.para1.alive == true && fired == true && wm.para1.BoundingBoxNoPara.Intersects(this.BoundingBox2)) { //wm.para1.BoundingBox wm.paratroopersKilled += 1; totalKilled += 1; wm.para1.alive = false; wm.para1.Position = new Vector2(600, 0); wm.para1.Velocity = new Vector2(0, 0); wm.para1.timing = 0f; wm.para1.otherBox = false; } } } #endregion //******************************************************************* //******************************************************************* // there may need to be a reset value for the movement when the phone is still /* else { Velocity= new Vector2(0,0); }*/ #region ChopperShotsWithUpGradesTakenIntoAccount for (int i=0;i<wm.WaveEnemies.Count;i++){ if (size == CrossHairSizeState.Original) { if (fired == true & wm.WaveEnemies[i].BoundingBox.Intersects(this.BoundingBox)) { wm.WaveEnemies[i].health -= strength; wm.WaveEnemies[i].Velocity.X = -wm.WaveEnemies[i].Velocity.X; wm.WaveEnemies[i].Velocity.Y = -wm.WaveEnemies[i].Velocity.Y; if (wm.WaveEnemies[i].health <= 0) { wm.WaveEnemies[i].alive = false; } } } //********************************************** if (size == CrossHairSizeState.OneAndAHalfBigger) { if (fired == true & wm.WaveEnemies[i].BoundingBox.Intersects(this.BoundingBox1point5)) { wm.WaveEnemies[i].health -= strength; wm.WaveEnemies[i].Velocity.X = -wm.WaveEnemies[i].Velocity.X; wm.WaveEnemies[i].Velocity.Y = -wm.WaveEnemies[i].Velocity.Y; if (wm.WaveEnemies[i].health <= 0) { wm.WaveEnemies[i].alive = false; } } } //********************************************** if (size == CrossHairSizeState.TwoTimes) { if (fired == true & wm.WaveEnemies[i].BoundingBox.Intersects(this.BoundingBox2)) { wm.WaveEnemies[i].health -= strength; wm.WaveEnemies[i].Velocity.X = -wm.WaveEnemies[i].Velocity.X; wm.WaveEnemies[i].Velocity.Y = -wm.WaveEnemies[i].Velocity.Y; if (wm.WaveEnemies[i].health <= 0) { wm.WaveEnemies[i].alive = false; } } } } #endregion #region JetsKilling if (size == CrossHairSizeState.Original) { if (fired = true && wm.j1.alive == true && wm.j1.boundingbox.Intersects(this.BoundingBox)) { totalKilled += 1; wm.jetsKilled += 1; wm.j1.alive = false; } if (fired = true && wm.j2.alive == true && wm.j2.boundingbox.Intersects(this.BoundingBox)) { totalKilled += 1; wm.jetsKilled += 1; wm.j2.alive = false; } } if (size == CrossHairSizeState.OneAndAHalfBigger) { if (fired = true && wm.j1.alive == true && wm.j1.boundingbox.Intersects(this.BoundingBox1point5)) { totalKilled += 1; wm.jetsKilled += 1; wm.j1.alive = false; } if (fired = true && wm.j2.alive == true && wm.j2.boundingbox.Intersects(this.BoundingBox1point5)) { totalKilled += 1; wm.jetsKilled += 1; wm.j2.alive = false; } } if (size == CrossHairSizeState.TwoTimes) { if (fired = true && wm.j1.alive == true && wm.j1.boundingbox.Intersects(this.BoundingBox2)) { totalKilled += 1; wm.jetsKilled += 1; wm.j1.alive = false; } if (fired = true && wm.j2.alive == true && wm.j2.boundingbox.Intersects(this.BoundingBox2)) { totalKilled += 1; wm.jetsKilled += 1; wm.j2.alive = false; } } #endregion }