So I made a map using the TILED application and I have it as a .tmx for reasons, but whenever I use the TildMap class in the Slick2D library to render the map on the screen, it gives me an error. Here are the files:
Class file:
public TiledMap testMap = null;
//TILE-READER
public static TileReader tileReader;
public Game (int stateID) {}
@Override
public int getID() {
return Main.game; //GAMESTATE = 1
}
@Override
public void init(GameContainer gameContainer, StateBasedGame stateBasedGame) throws SlickException {
worldMap = new Image ("res/in_game_map.png");
player = new Player(playerX, playerY, mapX, mapY);
tileReader = new TileReader();
player.init(gameContainer, stateBasedGame);
tileReader.init(gameContainer, stateBasedGame);
testMap = new TiledMap("res/worldMap.tmx");
}
@Override
public void update(GameContainer gameContainer, StateBasedGame stateBasedGame, int delta) throws SlickException {
player.update(gameContainer, stateBasedGame, delta);
tileReader.update(gameContainer, stateBasedGame, delta);
}
@Override
public void render(GameContainer gameContainer, StateBasedGame stateBasedGame, Graphics graphics) throws SlickException {
graphics.scale(1.05f, 1.05f);
graphics.translate(player.camera.getCamX(), player.camera.getCamY());
gameMap.draw(mapX - mapLength, mapY - mapWidth);
testMap.render(0, 0);
tileReader.render(gameContainer, stateBasedGame, graphics);
player.render(gameContainer, stateBasedGame, graphics);
graphics.translate(-player.camera.getCamX(), -player.camera.getCamY());
if (inputHandler.keyMAP) {
worldMap.draw(0, 0);
}
graphics.drawString("Player X: " + player.getxPos(), 400, 400);
graphics.drawString("Player Y: " + player.getyPos(), 400, 415);
}
And here is the error message that it provided me:
Caused by: org.newdawn.slick.SlickException: Unsupport tiled map type: base64,zlib (only gzip base64 supported)
Is there an issue with the way I formatted the .tmx file or is it that I am using the latest version of Tiled and that slick2D is no longer compatible with the newer version?