Exemplo n.º 1
0
        public void CreateTestImageRenderer()
        {
            testTextureImage = new Image();

            testRenderer = new ImageRenderer();
            testRenderer.ClearGradient();
            testRenderer.AddGradientPoint(-1.00, new Color(189, 94, 4, 255));
            testRenderer.AddGradientPoint(0.50, new Color(144, 48, 6, 255));
            testRenderer.AddGradientPoint(1.00, new Color(60, 10, 8, 255));

            testRenderer.EnableLight = false;
        }
Exemplo n.º 2
0
 private static void BuildTerrainRenderer(ImageRenderer renderer)
 {
     renderer.ClearGradient();
     renderer.AddGradientPoint(0, new Color(0, 0, 128, 255));
     renderer.AddGradientPoint(0.4, new Color(32, 64, 128, 255));
     renderer.AddGradientPoint(0.46, new Color(64, 96, 192, 255));
     renderer.AddGradientPoint(0.48, new Color(192, 192, 128, 255));
     renderer.AddGradientPoint(0.5, new Color(0, 192, 0, 255));
     renderer.AddGradientPoint(0.625, new Color(192, 192, 0, 255));
     renderer.AddGradientPoint(0.75, new Color(160, 96, 64, 255));
     renderer.AddGradientPoint(0.875, new Color(128, 255, 255, 255));
     renderer.AddGradientPoint(1.00, new Color(255, 255, 255, 255));
 }
Exemplo n.º 3
0
        public void CreateTestImageRenderer()
        {
            testTextureImage = new Image();

            testRenderer = new ImageRenderer();
            testRenderer.ClearGradient();
            testRenderer.AddGradientPoint(-1.0000, new Color(0, 0, 0, 255));
            testRenderer.AddGradientPoint(-0.9375, new Color(0, 0, 0, 255));
            testRenderer.AddGradientPoint(-0.8750, new Color(216, 216, 242, 255));
            testRenderer.AddGradientPoint(0.0000, new Color(191, 191, 191, 255));
            testRenderer.AddGradientPoint(0.5000, new Color(210, 116, 125, 255));
            testRenderer.AddGradientPoint(0.7500, new Color(210, 113, 98, 255));
            testRenderer.AddGradientPoint(1.0000, new Color(255, 176, 192, 255));
            testRenderer.EnableLight    = true;
            testRenderer.LightAzimuth   = 135;
            testRenderer.LightElevation = 60;
            testRenderer.LightContrast  = 2;
            testRenderer.LightColor     = new Color(255, 255, 255, 0);
        }
Exemplo n.º 4
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            nbEnemy = 0;

            gameover = false;

            world = new World(new Vector2(0, 0));

            debugView = new DebugView();
            debugView.LoadContent(GraphicsDevice, Content);

            inputHelper            = new InputHelper(resolutionIndependence);
            inputHelper.ShowCursor = true;

            shadowsRendering = new ShadowsRenderer();

            listGraphicObj = new List <GraphicObj>();

            inputHelper.LoadContent();

            font = Content.Load <SpriteFont>("pixelSpriteFont");

            Texture2D textureCarre  = Content.Load <Texture2D>("carre");
            Texture2D textureCarre2 = Content.Load <Texture2D>("carre2");
            Texture2D textureTotem  = Content.Load <Texture2D>("Totem");

            bouleRouge    = Content.Load <Texture2D>("blood");
            blood1        = Content.Load <Texture2D>("blood1");
            blood2        = Content.Load <Texture2D>("blood2");
            blood3        = Content.Load <Texture2D>("blood3");
            debugNodeBusy = Content.Load <Texture2D>("debugPathFinderNode");
            debugNodeFree = Content.Load <Texture2D>("debugPathFinderNode2");

            particuleSystem = new ParticuleSystem();

            //pathFinder = new PathFinder(2);
            pFinder = new PathFinder();
            pFinder.BuildtNavMeshes(6, 10);

            mapFactory = new MapFactory();
            mapFactory.newMap(listGraphicObj, seedIndexToLoad);
            seedIndexToLoad = -1;
            savedSeeds      = mapFactory.mGen.savedSeeds;
            var treeplanter = new TreePlanter(
                mapFactory.minX * pixelToMeter,
                mapFactory.maxX * pixelToMeter,
                mapFactory.minY * pixelToMeter,
                mapFactory.maxY * pixelToMeter,
                mapFactory.mGen.rand
                );

            frameRateCounter = new FrameRateCounter(font);

            particuleSystem.addParticuleSpawner(new SnowSpawner(new Vector2(100, 100), 0, player, new Vector2(475, -475)));

            snowMarkSpawner = new SnowMarkSpawner(new Vector2(0, 0), 0, player, new Vector2(0, 0));

            var noiseSource = new Perlin
            {
                Seed = mapFactory.mGen.rand.Next()
            };
            var noiseMap        = new NoiseMap();
            var noiseMapBuilder = new PlaneNoiseMapBuilder
            {
                DestNoiseMap   = noiseMap,
                SourceModule   = noiseSource,
                EnableSeamless = true
            };

            //noiseMapBuilder.SetDestSize(300, 300);
            //noiseMapBuilder.SetBounds(-4.5, 4.5, -4.5, 4.5);
            noiseMapBuilder.SetDestSize(256, 256);
            noiseMapBuilder.SetBounds(2, 6, 1, 5);

            noiseMapBuilder.Build();

            textureImageNoise = new SharpNoise.Utilities.Imaging.Image();

            imageRendererNoise = new ImageRenderer
            {
                SourceNoiseMap   = noiseMap,
                DestinationImage = textureImageNoise,
                EnableLight      = true,
                LightContrast    = 1.0,
                LightBrightness  = 2.3,
                EnableWrap       = true
            };

            imageRendererNoise.ClearGradient();

            imageRendererNoise.AddGradientPoint(0.0000, new SharpNoise.Utilities.Imaging.Color(170, 180, 240, 255));
            imageRendererNoise.AddGradientPoint(1.000, new SharpNoise.Utilities.Imaging.Color(170, 180, 240, 255));

            imageRendererNoise.Render();

            renderedmap = createTexture(imageRendererNoise);

            minNoiseX = (int)mapFactory.minX - textureImageNoise.Width * 2;
            maxNoiseX = (int)mapFactory.maxX + textureImageNoise.Width * 2;
            minNoiseY = (int)mapFactory.minY - textureImageNoise.Height * 2;
            maxNoiseY = (int)mapFactory.maxY + textureImageNoise.Height * 2;

            menu = new Menu(font);
        }
Exemplo n.º 5
0
 private static void BuildGrayscaleRenderer(ImageRenderer renderer)
 {
     renderer.ClearGradient();
     renderer.AddGradientPoint(0, new Color(0, 0, 0, 255));
     renderer.AddGradientPoint(1D, new Color(255, 255, 255, 255));
 }