public static TileMap loadMapFromFile(String path) throws IOException{
		System.out.println(Functions.getTimeStamp()+" [MAPMANAGER] : Parsing data from "+path+"...");
		InputStreamReader in = new InputStreamReader(ClassLoader.getSystemResourceAsStream(path));
		BufferedReader inputreader = new BufferedReader(in);
		String line = null;
		boolean found = false;
		TileMap tilemap = null;
		int x=0,y=0;
		while ( (line = inputreader.readLine()) != null) {
			if (line.compareTo("<spritelayer>") == 0){
				tilemap = new TileMap();
				found = true;
			} else if ( line.compareTo("</spritelayer>") == 0) {				
				found = false;
			} else if (found) {
				if (line.startsWith("[") && line.endsWith("]")){
					ArrayList<Tile> tileset = new ArrayList<Tile>();					
					String data = line.substring(1, line.length()-1);
					String[] dataarray = data.split(",");
					for (int i=0; i<dataarray.length;i++){
						tileset.add(new Tile(x, y, tilesize, 
								TextureManager.getSpriteFromSpriteSheet(TextureManager.WORLD, Integer.valueOf(dataarray[i]))));
						x+=tilesize;
						if ((x / tilesize) > 19) x = 0;
					}
					tilemap.addTileSet(tileset);					
					y+=tilesize;
					if ((y / tilesize) > 14) y = 0;
				}			
			} else {
				System.out.println(Functions.getTimeStamp()+" [MAPMANAGER] : Unknown/invalid line. Can't parse this line:"+line);
			}
		}
		inputreader.close();
		in.close();
		return tilemap;
	}