Example #1
0
        public MapRoot(int Width, int Height, int TileWidth, int TileHeight, string[] TextureNames, DynamicCamera Camera)
        {
            Layers = new MapLayer[3];
            Dimensions = new Size(Width, Height);
            TileDimensions = new Size(TileWidth, TileHeight);
            CollidableID = new HashSet<int> ();
            EnableCollision = false;
            ViewCamera = Camera;
            this.TextureNames = DefaultTextureNames;

            if(TextureNames.Length == 1)
            {
                this.TextureNames[0] = TextureNames[0];
                this.TextureNames[1] = TextureNames[0];
            }
            else if(TextureNames.Length == 2)
            {
                this.TextureNames[0] = TextureNames[0];
                this.TextureNames[1] = TextureNames[1];
            }
            else
            {
                this.TextureNames = TextureNames;
            }

            CreateLayers();
            CreateSpawns();
            CreateLights();
        }
Example #2
0
        public MapRoot(int Width, int Height, int TileWidth, int TileHeight, Texture2D texture, DynamicCamera Camera)
        {
            Layers = new MapLayer[3];
            Dimensions = new Size(Width, Height);
            TileDimensions = new Size(TileWidth, TileHeight);
            CollidableID = new HashSet<int> ();
            Texture = texture;
            ViewCamera = Camera;

            CreateBoundings ();
            CreateLayers();
            CreateSpawns();
            CreateLights();
        }