public override void DoIt() { if (Global.Round == (begin + 250)) { AssociatedGameObject.GetComponent <CDrawable>().cycle = 1; AssociatedGameObject.GetComponent <CDrawable>().HitBox = new Size(24, 24); AssociatedGameObject.offsetX += 18; AssociatedGameObject.offsetY += 5; AssociatedGameObject.AI = new AIActiveMine(AssociatedGameObject); } }
public override void DoIt() { GameObject foundZombie = Global.Entities.FindAll(x => x.Tags.Contains("Zombie")).Find(zombie => AssociatedGameObject.posX <= zombie.posX + zombie.GetComponent <CDrawable>().HitBox.Width&& AssociatedGameObject.posX + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Width >= zombie.posX && AssociatedGameObject.CorrectedY <= zombie.CorrectedY + zombie.GetComponent <CDrawable>().HitBox.Height&& AssociatedGameObject.CorrectedY + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Height >= zombie.CorrectedY); if (foundZombie != null) { foundZombie.GetComponent <CHealth>().Die(); AssociatedGameObject.GetComponent <CMoveable>().Speed = new System.Drawing.Point(180, 0); } }
public override void DoIt() { SunEntity sunEntity = AssociatedGameObject as SunEntity; if (AssociatedGameObject.posY <= sunEntity.EndingY) { AssociatedGameObject.GetComponent <CMoveable>().Stop(); } if (AssociatedGameObject.GetComponent <CClickable>().IsClicked) { AssociatedGameObject.Inactive = true; Global.dollar += 50; } }
public override void DoIt() { CHealth health = AssociatedGameObject.GetComponent <CHealth>(); CDrawable nutDraw = AssociatedGameObject.GetComponent <CDrawable>(); if (health.HP > 1333) { nutDraw.cycle = 0; } else if (health.HP < 1332 && health.HP > 666) { nutDraw.cycle = 1; } else { nutDraw.cycle = 2; } }
public override void DoIt() { GameObject foundZombie = Global.Entities.FindAll(x => x.Tags.Contains("Zombie")).Find(zombie => AssociatedGameObject.posX <= zombie.posX + zombie.GetComponent <CDrawable>().HitBox.Width&& AssociatedGameObject.posX + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Width >= zombie.posX && AssociatedGameObject.CorrectedY <= zombie.CorrectedY + zombie.GetComponent <CDrawable>().HitBox.Height&& AssociatedGameObject.CorrectedY + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Height >= zombie.CorrectedY); if (foundZombie != null) { AssociatedGameObject.GetComponent <CHealth>().GetDamage(1); CMoveable zombieMove = foundZombie.GetComponent <CMoveable>(); if (AssociatedGameObject.Tags.Contains("SnowPea") && zombieMove.Speed == zombieMove.InitialSpeed) { foundZombie.GetComponent <CDrawable>().Effect = "gel"; zombieMove.Speed = new Point(-5, 0); } foundZombie.GetComponent <CHealth>().GetDamage(15); } }
public override void DoIt() { GameObject foundPlant = Global.Entities.FindAll(x => x.Tags.Contains("Plant")).Find(plant => AssociatedGameObject.posX <= plant.posX + plant.GetComponent <CDrawable>().HitBox.Width&& AssociatedGameObject.posX + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Width >= plant.posX && AssociatedGameObject.CorrectedY <= plant.CorrectedY + plant.GetComponent <CDrawable>().HitBox.Height&& AssociatedGameObject.CorrectedY + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Height >= plant.CorrectedY); if (foundPlant != null) { AssociatedGameObject.GetComponent <CMoveable>().Stop(); foundPlant.GetComponent <CHealth>().GetDamage(2); } else { AssociatedGameObject.GetComponent <CMoveable>().Resume(); } if (AssociatedGameObject.posX <= 120 + AssociatedGameObject.GetComponent <CDrawable>().HitBox.Width) { Global.Entities.Clear(); Global.stateofthegame = Global.GameState.Loose; } }