Advertisement
Guest User

Untitled

a guest
Aug 11th, 2013
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1.     protected void loadLevel(String path)
  2.     {
  3.         parser = new JSONParser();
  4.         Object thisLevel;
  5.         try {
  6.             thisLevel = parser.parse(new FileReader(path));
  7.            
  8.             JSONObject jsonObject = (JSONObject) thisLevel;
  9.             JSONArray  layers     = (JSONArray) jsonObject.get("layers");
  10.             JSONObject  data       = (JSONObject) layers.get(0);
  11.  
  12.             System.out.println(data.get(2));
  13.  
  14. //          Iterator<String> iterator = map.iterator();
  15. //         
  16. //          while (iterator.hasNext())
  17. //          {
  18. //              System.out.println(iterator.next());
  19. //          }
  20.            
  21.         } catch (IOException | ParseException e) {
  22.             // TODO Auto-generated catch block
  23.             e.printStackTrace();
  24.         }
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement