Slick Forums

Discuss the Slick 2D Library
It is currently Sat May 25, 2013 8:43 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat Sep 15, 2012 7:01 pm 
Offline

Joined: Sat Sep 15, 2012 6:48 pm
Posts: 1
Hello everyone! :D
I develop a little 2d iso game,
also, i find slick and tiled, i'm create a tiled iso map, and i try it:
Code:
package hjc_geek;

import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Input;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.tiled.TiledMap;

/**
* A test of the tile map system based around the TilED (http://www.mapeditor.org) tool
*
* @author johynpapin
*/
public class test extends BasicGame {
   /** The tile map we're going to load and render */
   private TiledMap map;
   
   /** the name of the map, read from map properties, specified by TilED */
   private String mapName;
   
   /** how hard are the monsters, read from layer properties, specified by TilED */
   private String monsterDifficulty;
   
   /** we try to read a property from the map which doesn't exist so we expect the default value */
   private String nonExistingMapProperty;
   
   /** we try to read a property from the layer which doesn't exist so we expect the default value */
   private String nonExistingLayerProperty;
   
   /** how long did we wait already until next update */
   private int updateCounter = 0;
   
   /** changing some tile of the map every UPDATE_TIME milliseconds */
   private static int UPDATE_TIME = 1000;
   
   /** we want to store the originalTileID before we set a new one */
   private int originalTileID = 0;
   
   /**
    * Create our tile map test
    */
   public test() {
       super("Tile Map Test");
   }
   
   /**
    * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
    */
   public void init(GameContainer container) throws SlickException {
       map = new TiledMap("iso-test.tmx","testdata");
       // read some properties from map and layer
       mapName = map.getMapProperty("name", "Unknown map name");
       monsterDifficulty = map.getLayerProperty(0, "monsters", "easy peasy");
       nonExistingMapProperty = map.getMapProperty("zaphod", "Undefined map property");
       nonExistingLayerProperty = map.getLayerProperty(1, "beeblebrox", "Undefined layer property");
       
       // store the original tileid of layer 0 at 10, 10
       originalTileID = map.getTileId(10, 10, 0);
   }

   /**
    * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
    */
   public void render(GameContainer container, Graphics g) {
       map.render(10, 10, 4,4,15,15);
       
       g.scale(0.35f,0.35f);
       map.render(1400, 0);
       g.resetTransform();
       
       g.drawString("map name: " + mapName, 10, 500);
       g.drawString("monster difficulty: " + monsterDifficulty, 10, 550);
       
       g.drawString("non existing map property: " + nonExistingMapProperty, 10, 525);
       g.drawString("non existing layer property: " + nonExistingLayerProperty, 10, 575);
   }

   /**
    * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer, int)
    */
   public void update(GameContainer container, int delta) {
       updateCounter += delta;
       if (updateCounter > UPDATE_TIME) {
           // swap the tile every second
           updateCounter -= UPDATE_TIME;
           int currentTileID = map.getTileId(10, 10, 0);
           if (currentTileID != originalTileID)
               map.setTileId(10, 10, 0, originalTileID);
           else
               map.setTileId(10, 10, 0, 1);
       }
   }

   /**
    * @see org.newdawn.slick.BasicGame#keyPressed(int, char)
    */
   public void keyPressed(int key, char c) {
       if (key == Input.KEY_ESCAPE) {
           System.exit(0);
       }
   }
   
   /**
    * Entry point to our test
    * 
    * @param argv The arguments passed to the test
    */
   public static void main(String[] argv) {
       try {
           AppGameContainer container = new AppGameContainer(new test());
           container.setDisplayMode(800,600,false);
           container.start();
       } catch (SlickException e) {
           e.printStackTrace();
       }
   }



but, i have it:
Code:
Failed to open device (/dev/input/event13): Failed to open device /dev/input/event13 (13)

Failed to open device (/dev/input/event12): Failed to open device /dev/input/event12 (13)

Failed to open device (/dev/input/event11): Failed to open device /dev/input/event11 (13)

Failed to open device (/dev/input/event10): Failed to open device /dev/input/event10 (13)

Failed to open device (/dev/input/event9): Failed to open device /dev/input/event9 (13)

Failed to open device (/dev/input/event8): Failed to open device /dev/input/event8 (13)

Failed to open device (/dev/input/event7): Failed to open device /dev/input/event7 (13)

Failed to open device (/dev/input/event6): Failed to open device /dev/input/event6 (13)

Failed to open device (/dev/input/event5): Failed to open device /dev/input/event5 (13)

Failed to open device (/dev/input/event4): Failed to open device /dev/input/event4 (13)

Failed to open device (/dev/input/event3): Failed to open device /dev/input/event3 (13)

Failed to open device (/dev/input/event2): Failed to open device /dev/input/event2 (13)

Failed to open device (/dev/input/event1): Failed to open device /dev/input/event1 (13)

Failed to open device (/dev/input/event0): Failed to open device /dev/input/event0 (13)

Linux plugin claims to have found 0 controllers
Sat Sep 15 20:58:33 CEST 2012 INFO:Found 0 controllers
Sat Sep 15 20:58:33 CEST 2012 ERROR:Only orthogonal maps supported, found: isometric
org.newdawn.slick.SlickException: Only orthogonal maps supported, found: isometric
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:415)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:101)
   at hjc_geek.test.init(test.java:52)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
   at hjc_geek.test.main(test.java:114)
Sat Sep 15 20:58:33 CEST 2012 ERROR:Failed to parse tilemap
org.newdawn.slick.SlickException: Failed to parse tilemap
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:480)
   at org.newdawn.slick.tiled.TiledMap.<init>(TiledMap.java:101)
   at hjc_geek.test.init(test.java:52)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:390)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:314)
   at hjc_geek.test.main(test.java:114)
Caused by: org.newdawn.slick.SlickException: Only orthogonal maps supported, found: isometric
   at org.newdawn.slick.tiled.TiledMap.load(TiledMap.java:415)
   ... 5 more


Can you help me?

ps:
I'm french, excuse my english. :oops:


Top
 Profile  
 
PostPosted: Sat Sep 29, 2012 11:19 pm 
Offline

Joined: Sat Sep 29, 2012 8:13 pm
Posts: 9
Hi, I had the same problem as you it have. The reason is in the exception:
Code:
Only orthogonal maps supported, found: isometric

means that NO isometric maps are supported from slick. Support for isometric maps is uncluded in the dev version of slick, I tested it and it works!

How to get the dev version: http://slick.cokeandcode.com/wiki/doku. ... ent_branch


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group