Example #1
0
        public void Load(ContentManager c)
        {
            texLoader.prepareTextures(c);
            int i = 0;
            for (int y = 0; y < height; y++)
            {
                for (int x = 0; x < width; x++)
                {
                    // Use grass by default
                    tileset[i] = new Tile(texLoader.getTexture(TileTextureLoader.GRASS), x, y, 1, "0000", true);
                    // Put walk border on sides of map to prevent user from exiting game screen.
                    if (x == 0 || x == (width - 1) || y == 0 || y == (height - 1))
                    {
                        // Void the borders
                        tileset[i].SetTexture(texLoader.getTexture(TileTextureLoader.VOID));
                        tileset[i].SetTypeID(TileTextureLoader.VOID);
                        // Unwalkable
                        tileset[i].SetWalkable(false);
                    }
                    i++;
                }
            }

            //Load texture and collision map
            EnvironmentLoader loader = new EnvironmentLoader(this);
            loader.LoadTileTextureMap();
        }