private bool CanRotate(Enity enity) { if (enity.X % _cellSize == 0 && enity.Y % _cellSize == 0) { return(true); } return(false); }
private bool CollidesWithBorders(Enity enity) { if (enity.X < 0 && enity.Directon == Directon.LEFT || enity.Y < 0 && enity.Directon == Directon.UP || enity.X + enity.Size > _size.Width && enity.Directon == Directon.RIGHT || enity.Y + enity.Size > _size.Height && enity.Directon == Directon.DOWN || CollidesWithWalls(enity)) { return(true); } return(false); }
public Bullet(int size, Enity parent) : base(size, new Point(parent.X + parent.Size / 2 - 1, parent.Y + parent.Size / 2 - 1), parent.Directon) { }
private bool CollidesWithWalls(Enity enity) { return(Collides(enity, _walls)); }