Esempio n. 1
0
        private void AddWalls(List <RigidShape> staticShapes, Size levelSizeInTiles)
        {
            var circle = new RigidCircle(Vector.ZeroVector, 32, true, true);

            for (var j = 1; j < levelSizeInTiles.Width - 1; ++j)
            {
                for (var i = 1; i < levelSizeInTiles.Height - 1; ++i)
                {
                    circle.MoveTo(new Vector(j, i) * 32);
                    var canWalk = true;
                    foreach (var staticShape in staticShapes)
                    {
                        if (CollisionDetector.GetCollisionInfo(circle, staticShape) == null)
                        {
                            continue;
                        }
                        canWalk = false;
                        break;
                    }

                    if (!canWalk)
                    {
                        walls.Add(new Point(j, i));
                    }
                }
            }
        }
Esempio n. 2
0
 public void MoveTo(Vector newPosition) => CollisionShape.MoveTo(newPosition);
Esempio n. 3
0
 public void MoveTo(Vector newPosition) => shape.MoveTo(newPosition);