Esempio n. 1
0
        public void Render()
        {
            // RENDER YOUR GAME HERE
            // Use the static class "Renderer"
            // EXAMPLES:
            // Renderer.CurrentCamera = cameraYouWantToUse;
            Renderer.CurrentCamera = _camera;

            //Renderer.SetProjectionMatrix();

            _octree.Foreach(
                (Unit model) =>
            {
                if (!model.IsDead)
                {
                    Renderer.DrawStaticModel(model.StaticModel);
                }
            },
                new double[] { -100000, -100000, -100000, },
                new double[] { 100000, 100000, 100000 });

            if (_showlines)
            {
                lines.Foreach
                (
                    (Link <Vector <float>, Vector <float>, Color> current) =>
                {
                    Renderer.DrawLine(current.One, current.Two, current.Three);
                }
                );
            }

            explosions.Foreach
            (
                (Explosion current) =>
            {
                if (current.Model.Scale.X < 220)
                {
                    Renderer.DrawStaticModel(current.Model);
                    current.Model.Scale.X += 2.5f;
                    current.Model.Scale.Y += 2.5f;
                    current.Model.Scale.Z += 2.5f;
                }
            }
            );

            Renderer.DrawSkybox(_skybox);
            Renderer.DrawStaticModel(_terrain);
            Renderer.DrawStaticModel(_mountain);
            Renderer.DrawStaticModel(_mountain2);

            // EXAMPLE:
            // Renderer.RenderText("whatToWrite", x, y, size, rotation, color);
            Renderer.RenderText("Welcome To", 0f, 1f, 50f, 0, Color.Black);
            Renderer.RenderText("SevenEngine!", .15f, .95f, 50f, 0, Color.Teal);

            Renderer.RenderText("Battle Controls: Space, R, T, G, Y", .55f, .95f, 30f, 0, Color.Black);

            Renderer.RenderText("Map: " + _map, .85f, .85f, 30f, 0, Color.Black);
            if (_3d)
            {
                Renderer.RenderText("Space: Yes", .85f, .9f, 30f, 0, Color.Black);
            }
            else
            {
                Renderer.RenderText("Space: No", .85f, .9f, 30f, 0, Color.Black);
            }

            Renderer.RenderText("Unit Controls: z, x, c, v, b, n", .6f, .07f, 30f, 0, Color.Black);
            Renderer.RenderText("Unit Counts (M-R-K): " + _meleeCount + " " + _rangedCount + " " + _kamakaziCount, .6f, .12f, 30f, 0, Color.Black);

            Renderer.RenderText("Close: ESC", 0f, .2f, 30f, 0f, Color.White);
            Renderer.RenderText("Fullscreen: F1", 0f, .15f, 30f, 0, Color.SteelBlue);
            Renderer.RenderText("Camera Movement: w, a, s, d", 0f, .1f, 30f, 0, Color.Tomato);
            Renderer.RenderText("Camera Angle: j, k, l, i", 0f, .05f, 30f, 0, Color.Yellow);
        }