Beispiel #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);
     }
   }
 }
Beispiel #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;
  }
Beispiel #3
0
 public int getYScroll() {
   return Math.round(yScroll);
 }
Beispiel #4
0
 public int getXScroll() {
   return Math.round(xScroll);
 }