/** * 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); } } }
// 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; }
public int getYScroll() { return Math.round(yScroll); }
public int getXScroll() { return Math.round(xScroll); }