public Bomb(Vector2 pos, GameManager gm, Player sp) : base(pos, gm) { spawningPlayer = sp; exploding = false; radius = 75; width = WIDTH; height = HEIGHT; ignorePlayerMovement = true; }
public SpacebarItem(Player p, GameManager m) { player = p; manager = m; charge = maxCharge; }
public override void UpdateCollisions(List<Tile> tiles, List<Actor> actors, List<Player> players) { double closestDist = 500; foreach (Player p in players) { double distX = Math.Abs(GetRect().Center.X - p.GetRect().Center.X); double distY = Math.Abs(GetRect().Center.Y - p.GetRect().Center.Y); double dist = Math.Sqrt(Math.Pow(distX, 2) + Math.Pow(distY, 2)); if (dist < closestDist) { closestPlayer = p; } } base.UpdateCollisions(tiles, actors, players); }