public SolidGrid(Grid grid) : base(-3) { Collider = grid; Tag(GameTags.Solid); }
public abstract bool Collide(Grid grid);
public override bool Collide(Grid grid) { throw new NotImplementedException(); }
public override bool Collide(Grid grid) { if (Intersects(grid.AbsoluteLeft, grid.AbsoluteTop, grid.Width, grid.Height)) { int x = (int)((AbsoluteLeft - grid.AbsoluteLeft) / grid.CellWidth); int y = (int)((AbsoluteTop - grid.AbsoluteTop) / grid.CellHeight); int w = (int)((AbsoluteRight - grid.AbsoluteLeft - 1) / grid.CellWidth) - x + 1; int h = (int)((AbsoluteBottom - grid.AbsoluteTop - 1) / grid.CellHeight) - y + 1; return grid.CheckRect(x, y, w, h); } else return false; }
public override bool Collide(Grid grid) { foreach (var c in colliders) if (c.Collide(grid)) return true; return false; }
public override bool Collide(Grid grid) { return grid.Collide(this); }
public override bool Collide(Grid grid) { return grid.Collide(Bounds); }