예제 #1
0
 /**
  * Render the IsoMap at its current offset.
  *
  * @throws SlickException
  */
 public void render() throws SlickException {
   for (int y = 0; y < mapHeight; y++) {
     for (int x = 0; x < mapWidth; x++) {
       tilesArray[x][y].render(Math.round(xScroll), Math.round(yScroll), this);
     }
   }
 }
예제 #2
0
  // Create a new IsoMap
  public IsoMap(Tile[][] tiles, int mapWidth, int mapHeight, GameBasics game) {
    this.game = game;
    this.mapWidth = mapWidth;
    this.mapHeight = mapHeight;

    xScroll = Math.round(game.getWidth() - (mapWidth + 0.5f) * TileDef.TILE_WIDTH) / 2;
    yScroll = Math.round(game.getHeight() - (mapHeight + 1f) * TileDef.TILE_HEIGHT / 2) / 2;

    tilesArray = tiles;
  }
예제 #3
0
 public int getYScroll() {
   return Math.round(yScroll);
 }
예제 #4
0
 public int getXScroll() {
   return Math.round(xScroll);
 }