Esempio n. 1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            Texture2D tilesetTexture = Content.Load<Texture2D>(@"TileSets\TileSet3");
            tileset = new TileSet(tilesetTexture, 8, 8, 32, 32);

            List<TileSet> tilesets = new List<TileSet>();
            tilesets.Add(tileset);

            MapLayer Layer = new MapLayer(500,500);
            for (int y = 0; y < Layer.Height; y++)
            {
                for (int x = 0; x < Layer.Width; x++)
                {

                    Layer.SetTile(0, x, y);

                }
            }

            List<MapLayer> mapLayers = new List<MapLayer>();
            mapLayers.Add(Layer);

            map = new TileMap(tilesets, mapLayers);
            // TODO: use this.Content to load your game content here
        }
Esempio n. 2
0
        public TileMap(TileSet tileset, MapLayer layer)
        {
            tilesets = new List<TileSet>();
            tilesets.Add(tileset);

            mapLayers = new List<MapLayer>();
            mapLayers.Add(layer);
        }