コード例 #1
0
        public void Initialise(EnvironmentPreset preset)
        {
            _backgroundObjects.Add(_moon);

            _preset = preset;

            _terrainFactory = new TerrainFactoryMidpoint(
                _windowRect, Constants.TerrainWidth,
                Constants.TerrainDepth, _camera);

            for (int i = 0; i < Constants.NumberParallaxBackgrounds; i++)
            {
                Terrain _generatedTerrain = _terrainFactory.Generate(_preset.ParallaxBgColor[i],
                                                                     Constants.AverageTerrainHeight + i * 50 - 400, _preset.ParallaxBgCoef[i]);

                _generatedTerrain.TerrainDistance = Constants.DistFromInfinity / Constants.NumberParallaxBackgrounds * (Constants.NumberParallaxBackgrounds - i);

                _backgroundTerrain.Add(_generatedTerrain);
            }

            _weatherDelayCount = 0;
        }
コード例 #2
0
        public Terrain Generate()
        {
            Terrain _terrain = _terrainFactory.Generate(SwinGame.RGBAColor(241, 243, 246, 255));

            return(_terrain);
        }
コード例 #3
0
        public Terrain Generate()
        {
            Terrain _terrain = _terrainFactory.Generate(SwinGame.RGBAFloatColor(0.4f, 0.6f, 0.4f, 1f));

            return(_terrain);
        }