Пример #1
0
 private static LevelFile.CollisionMapSection ConvertCollisionMap(CollisionMap collisionMap)
 {
     return(new LevelFile.CollisionMapSection()
     {
         Width = collisionMap.Width,
         Height = collisionMap.Height,
         Data = ConvertCollisionMapData(collisionMap)
     });
 }
Пример #2
0
        private static BlockType[][] ConvertCollisionMapData(CollisionMap collisionMap)
        {
            var data = new BlockType[collisionMap.Height][];

            for (int y = 0; y < collisionMap.Height; y++)
            {
                data[y] = new BlockType[collisionMap.Width];

                for (int x = 0; x < collisionMap.Width; x++)
                {
                    data[y][x] = collisionMap[x, y];
                }
            }

            return(data);
        }
Пример #3
0
 public Level(int width, int height)
 {
     Width        = width;
     Height       = height;
     CollisionMap = new CollisionMap(width / BlockSize, height / BlockSize);
 }