public void saveScene(File file) {
		if (tileset.isUnsaved()) {
			throw new RuntimeException(
					"Tileset is unsaved. Cannot save the scene");
		}

		try {
			PrintWriter writer = new PrintWriter(new BufferedWriter(
					new FileWriter(file)));

			String line = "";

			int width = map.getWidth();
			int height = map.getHeight();

			File wd = new File(file.getParentFile().getCanonicalFile()
					.toString());
			File ts = new File(tileset.getFile().getCanonicalFile().toString());

			String relativePath = RelativePath.getRelativePath(wd, ts);

			line = width + " " + height + " " + relativePath;
			writer.println(line);

			line = "colorization " + effect_rScale + " " + effect_gScale + " "
					+ effect_bScale + " " + effect_hue + " " + effect_sat;
			writer.println(line);

			System.out.println("Colorization red in save is " + effect_rScale);
			writer.println(".");

			for (int z = 0; z < 3; z++) {
				for (int i = 0; i < height; i++) {
					for (int j = 0; j < width; j++) {
						Tile t = map.getTile(j, i, z);
						if (t != null)
							writer.print(t.getNumber() + " ");
						else
							writer.print("0 ");

					}

				}
				writer.println();
			}

			writer.flush();
			writer.close();

		} catch (IOException e) {
			throw new RuntimeException("Could not save the level");
		}

		System.err.println("Saved");
	}