protected virtual bool Collides(Basic2d asset) { Rectangle box = BoundingBox; box.Y -= box.Height; return(box.Intersects(asset.BoundingBox)); }
protected override bool Collides(Basic2d asset) { Rectangle box = BoundingBox; box.Y -= box.Height; if (box.Intersects(asset.BoundingBox)) { Direction = !Direction; PixesMoved = 0; return(true); } else { return(false); } }
private bool CollidesCharacter(Basic2d asset) { Rectangle box; foreach (Enemy enemy in Globals.EnemiesAssets) { box = enemy.BoundingBox; box.Y -= box.Height; if (asset.BoundingBox.Intersects(box)) { return(true); } } box = Globals.Hero.BoundingBox; box.Y -= box.Height; if (asset.BoundingBox.Intersects(box)) { return(true); } return(false); }