public void RemoveBolt(Bolt b) { myBolts.Remove(b); }
public void BoltAttack() { if (boltTimer < 0) { if (faceRight) { myBolt = new Bolt(boltImg1, myPosition + new Vector2(myTexture.Width / 2, myTexture.Height / 2), new Vector2(0, 0)); myGame.AddBolt(myBolt); } else { myBolt = new Bolt(boltImg1, myPosition + new Vector2(myTexture.Width - 1000, myTexture.Height / 2), new Vector2(0, 0)); myGame.AddBolt(myBolt); } } boltTimer = 100; //myGame.RemoveBolt(myBolt); }
public Boolean CollisionBoltAndEnemy(Bolt B, Enemy E) { Vector2 MPos = B.getPosition(); Vector2 EPos = E.getPosition(); if (MPos.X + (B.getBolt1().Width) > EPos.X && MPos.Y + (B.getBolt1().Height) > EPos.Y && MPos.X + (B.getBolt1().Width) < EPos.X + E.getTex().Width && MPos.Y + (B.getBolt1().Height) < EPos.Y + E.getTex().Height || MPos.X + (B.getBolt1().Width) > EPos.X && MPos.Y > EPos.Y && MPos.X + (B.getBolt1().Width) < EPos.X + E.getTex().Width && MPos.Y < EPos.Y + E.getTex().Height || MPos.X > EPos.X && MPos.Y + (B.getBolt1().Height) > EPos.Y && MPos.X < EPos.X + E.getTex().Width && MPos.Y + (B.getBolt1().Height) < EPos.Y + E.getTex().Height || MPos.X > EPos.X && MPos.Y > EPos.Y && MPos.X < EPos.X + E.getTex().Width && MPos.Y < EPos.Y + E.getTex().Height) { return true; } return false; }