Example #1
0
 public SolidGrid(Grid grid)
     : base(-3)
 {
     Collider = grid;
     Tag(GameTags.Solid);
 }
Example #2
0
 public abstract bool Collide(Grid grid);
Example #3
0
 public override bool Collide(Grid grid)
 {
     throw new NotImplementedException();
 }
Example #4
0
        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;
        }
Example #5
0
        public override bool Collide(Grid grid)
        {
            foreach (var c in colliders)
                if (c.Collide(grid))
                    return true;

            return false;
        }
Example #6
0
 public override bool Collide(Grid grid)
 {
     return grid.Collide(this);
 }
Example #7
0
 public override bool Collide(Grid grid)
 {
     return grid.Collide(Bounds);
 }