Esempio n. 1
0
 public Game(IRendererFactory renderFactory)
 {
     GameMode = GameModes.Play;
     this.renderFactory = renderFactory;
     Level = new Level.Level(this, renderFactory.LevelRenderer);
     Robot = new Robot.Robot(this, renderFactory.RobotRenderer);
     HUD = new Hud(this, renderFactory.HudRenderer,
         renderFactory.CommandBarRenderer, renderFactory.CommandMainProgramRenderer, renderFactory.FunctionOneRenderer, renderFactory.FunctionTwoRenderer,
         renderFactory.HudIconFactory);
     MainProgram = new CommandList(this);
     FunctionOneCommands = new CommandList(this);
     FunctionTwoCommands = new CommandList(this);
     CommandFactory.GameHandler = this;
     Position = new RobotPosition(this);
 }
        public void Render(Robot robot)
        {
            GL.Disable(EnableCap.ColorMaterial);

            const double DRAGON_SIZE = 1.5;
            GL.PushMatrix();
            {
                GL.ColorMaterial(MaterialFace.FrontAndBack, ColorMaterialParameter.AmbientAndDiffuse);
                GL.Translate(xPosition, yPosition, -zPosition);
                GL.Rotate(-110, 0, 1.0, 0);
                GL.Scale(DRAGON_SIZE, DRAGON_SIZE, DRAGON_SIZE);
                GL.Rotate(rotation, 0, 1.0, 0);
                setMaterials();
                robotModel.Render();
            }
            GL.PopMatrix();
        }