Пример #1
0
        // private initializer for an "empty" collision map
        private CollisionMap()
        {
            MapData = new Map() { Data = new int[800], Width = 80 };
            TileSize = 16;

            for( int i = 0; i < MapData.Data.Length; i++ )
            {
                MapData.Data[ i ] = -1;
            }
        }
Пример #2
0
        public MapLayer( Vector2? parallax, int tileSize = 16, int[] mapData = null )
            : base( parallax )
        {
            MapData = new Map();

            TileSize = tileSize;

            if( mapData != null )
                MapData.Data = mapData;

            DrawMethod = DrawMap;

            SamplerState = SamplerState.PointClamp;

            if( MapData.Data == null || MapData.IsEmpty() )
            {
                MapData.Data = new int[ 45 * 80 ];
                MapData.Width = 80;
                Prefill();
            }
        }
Пример #3
0
 public CollisionMap( Level level )
 {
     MapData = level.CollisionLayer.MapData;
     TileSize = level.CollisionLayer.TileSize;
 }