Пример #1
0
        public WizardWarsGameWindow() : base(800, 600, GraphicsMode.Default, "WizardWars 0.0.1")
        {
            VSync = VSyncMode.On;

            lib.Texture _texGrass      = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\grass_64x64.png");
            lib.Texture _texGrassWater = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\grass_water_64x64.png");
            lib.Texture _texWater      = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\water_64x64.png");
            lib.Texture _texHouse      = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\house_64x64_2.png");
            lib.Texture _texGrid       = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\grid_64x64.png");
            lib.Texture _hexGrid       = new lib.Texture("G:\\Archive\\Pictures\\2D\\Textures\\hex_64x64.png");
            textureIdGrid = _hexGrid.GetId();

            List <lib.MapLayer> _mapLayers = new List <lib.MapLayer>();

            lib.Texture[,] terrainTextures = new lib.Texture[9, 9];
            for (int x = 0; x < 9; x++)
            {
                for (int y = 0; y < 9; y++)
                {
                    if (x % 2 == 0 && y % 8 == 0)
                    {
                        terrainTextures[x, y] = _texGrass;
                    }
                    else
                    {
                        terrainTextures[x, y] = _texGrass;
                    }
                }
            }
            lib.MapLayer terrainLayer = new lib.MapLayer(terrainTextures);
            _mapLayers.Add(terrainLayer);


            // Resources layer
            lib.Texture[,] resourcesTextures = new lib.Texture[9, 9];
            for (int x = 0; x < 9; x++)
            {
                for (int y = 0; y < 9; y++)
                {
                    //if (x == 3 && y == 2)
                    resourcesTextures[x, y] = _texHouse;
                    //else
                    // resourcesTextures[x, y] = _texGrass;
                }
            }
            lib.MapLayer resourcesLayer = new lib.MapLayer(resourcesTextures);
            _mapLayers.Add(resourcesLayer);

            // GridLayer
            lib.Texture[,] gridTextures = new lib.Texture[9, 9];
            for (int x = 0; x < 9; x++)
            {
                for (int y = 0; y < 9; y++)
                {
                    gridTextures[x, y] = _texGrid;
                }
            }
            lib.MapLayer gridLayer = new lib.MapLayer(gridTextures);
            _mapLayers.Add(gridLayer);


            hexMap = new lib.HexMap(new lib.MapDimension(9), new lib.MapDimension(9), _mapLayers);
        }