public void Render(Level level)
 {
     floorSize = level.FloorSize;
     GL.Translate(Tile.TILE_SIZE * floorSize / 2, 0, -Tile.TILE_SIZE * floorSize / 2);
     GL.Rotate(currentAngle, 0, 1, 0);
     GL.Translate(-Tile.TILE_SIZE * floorSize / 2, 0, Tile.TILE_SIZE * floorSize / 2);
     drawBase();
     drawTiles(level);
 }
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);
 }
 private void drawTiles(Level level)
 {
     for (int row = 0; row < floorSize; row++)
     {
         for (int column = 0; column < floorSize; column++)
         {
             GL.PushMatrix();
             GL.Translate(TileSize * row, -0.5f, -TileSize * column);
             renderTile(level.Floor[row, column]);
             GL.PopMatrix();
         }
     }
 }