public void dump(int x, int y, boolean fore){
		try{
		if(tiles[x][y] != null){
			if(fore){
				if(tiles[x][y].foreground != null){	
					tiles[x][y].foreground.dump();
					tiles[x][y].foreground = null;
				}
			} else {
				if(tiles[x][y].background != null){	
					tiles[x][y].background.dump();
					tiles[x][y].background = null;
				}
			}
		}
		} catch(Exception e){
			e.printStackTrace();
		}
	}