public void Update(RobotPosition position, GameTime gameTime)
 {
     int row = position.Row;
     int column = position.Column;
     double heightPosition = LevelRenderer.GetTileHeightOpenGLUnits(position.Height);
     double timeFactor = calculateTimeFactor(gameTime);
     xPosition = calculatePosition(timeFactor, xPosition, row * LevelRenderer.TileSize);
     yPosition = calculatePosition(timeFactor, yPosition, heightPosition);
     zPosition = calculatePosition(timeFactor, zPosition, column * LevelRenderer.TileSize);
     rotation = calculatePosition(timeFactor, rotation, (int)position.Direction);
 }
Beispiel #2
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);
 }