private void load(File fileName) throws IOException
	{
		FileRead fp = new FileRead(fileName);

		if (fp != null)
		{
			LevelLayer curElem = null;

			while (fp.hasNext())
			{
				switch (fp.getNext())
				{
					case "COLLISION":
						collision = new Collision(fp.getNext(), Integer.parseInt(fp.getNext()));
					break;
					case "LAYER":
						curElem = new LevelLayer(this);
						layers.push(curElem);
						curElem.load(Integer.parseInt(fp.getNext()));
					break;
					case "IMG":
						curElem.load(Data.getDataDirectory() + "/data/gfx/tileset/" + fp.getNext(), Integer.parseInt(fp.getNext()), Integer.parseInt(fp.getNext()), Integer.parseInt(fp.getNext()), Integer.parseInt(fp.getNext()));
						curElem.load(fp); // load the tileset
					break;
					case "OBJECTS":
						loadObjects(fp);
					break;

					default:
					break;
				}
			}

			if (layers.size() == 0)
			{
				throw new IOException("No level layers found in:\n"+fileName+"\nPerhaps it is not a valid level file?");
			}
		}

		fp.close();
	}