Exemplo n.º 1
0
        internal static ScreenMap CreateMap()
        {
            ScreenMap newMap = new ScreenMap();

            newMap.id        = 0;
            newMap.tiles     = LoadMapFromFile("map1.mapr");
            newMap.mapType   = 22;
            newMap.tilesName = "tiles";
            return(newMap);
        }
Exemplo n.º 2
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);
            ScreenMap screenMap = Maps.CreateMap();

            LoadMapResources(screenMap);
            BackgroundToDraw = new Tile[15, 25];
            for (int x = 0; x < 15; x++)
            {
                for (int y = 0; y < 25; y++)
                {
                    int id = screenMap.tiles[x, y];
                    BackgroundToDraw[x, y] = Maps.GetTile(id, mapTiles, x, y);
                }
            }
            character = new Character(this.Content.Load <Texture2D>("character"));
        }
Exemplo n.º 3
0
 internal void LoadMapResources(ScreenMap screenMap)
 {
     mapTiles = this.Content.Load <Texture2D>(screenMap.tilesName);
 }