public void paint(Graphics g) {
		BufferedImage image = new BufferedImage(SCREEN_W, SCREEN_H, BufferedImage.TYPE_INT_RGB);
		Graphics2D g2d = image.createGraphics();
		super.paint(g2d);

		if(loading) return;

	    synchronized(this){
	    	int xOffset = getOffset(player.getColumn(), 13,COLUMNS);
	    	int yOffset = getOffset(player.getRow(), 9, ROWS);
	    	
			g2d.drawImage(gridLayers.get(GridType.FLOOR).getImage(), -xOffset, -yOffset, null);
			g2d.drawImage(gridLayers.get(GridType.WALLS).getImage(), -xOffset, -yOffset, null);
			g2d.drawImage(gridLayers.get(GridType.TRAPS).getImage(), -xOffset, -yOffset, null);
			g2d.drawImage(gridLayers.get(GridType.BONUS).getImage(), -xOffset, -yOffset, null);
			// g2d.drawImage(gridLayers.get(GridType.ITEMS).getImage(), -xOffset, -yOffset, null);
			g2d.drawImage(gridLayers.get(GridType.MONSTERS).getImage(), -xOffset, -yOffset, null);
			g2d.drawImage(gridLayers.get(GridType.PLAYERS).getImage(), -xOffset, -yOffset, null);
	    }
	    
		g2d.setColor(Color.GRAY);
		g2d.drawLine(0, SCREEN_H-40, SCREEN_W, SCREEN_H-40);

		g2d.drawImage(heartIcon, 4, SCREEN_H-36, null);
		
		g2d.setColor(Color.RED);
		g2d.fill(new Rectangle2D.Double(40, SCREEN_H-30, 100, 20));
		g2d.setColor(Color.GREEN);
		g2d.fill(new Rectangle2D.Double(40, SCREEN_H-30, 100*(player.getHP()/player.getMaxHP()), 20));
		
		g2d.setColor(Color.BLACK);
		g2d.drawString((int)player.getHP()+"/"+(int)player.getMaxHP(), 65, SCREEN_H-15);
		
		if(minimapEnabled) g2d.drawImage(minimap.getImage(), minimap.getX(), minimap.getY(), null);

		ArrayList<Bag> bags = player.getBags();
		for (int i = 0; i < bags.size(); i ++) {
			Bag<?> bag = bags.get(i);
			int x = 700-i*bagSize;
			if (bag.isOpen()) {
				int rows = bag.getRows();
				int columns = bag.getColumns();
				
				g2d.drawImage(bagPanelImage, x, 500, null);
				g2d.setColor(new Color(0,0,0,128));
				g2d.fill(new Rectangle(x, 500, bagSize, bagSize));
				
				g2d.setColor(new Color(0,0,255,128));
				g2d.fill(new Rectangle(x-columns*bagSize+bagSize, 500-rows*bagSize, columns*bagSize, rows*bagSize));
				
				ArrayList<Item>[][] items = bag.getItems();
				for (int row = 0; row < items.length; row++) {
					for (int column = 0; column < items[row].length; column++) {
						ArrayList<Item> item = items[row][column];
					
						g2d.setColor(new Color(row*25,column*25,row*column*15, 128));
						g2d.fill(new Rectangle(x-column*64, 500-row*64-64, bagSize, bagSize));
						
						if(item.size() > 0) {
							g2d.drawImage(item.get(0).getImage(), x-column*64, 500-row*64-64, null);
							if(item.size() >1) {
								g2d.setColor(Color.WHITE);
								g2d.drawString(item.size()+"", x-column*64, 500-row*64);
							}
						}
					}
				}

			}
			else {
				g2d.drawImage(bagPanelImage, x, 500, null);
			}
		}
		
		Graphics2D g2d_final = (Graphics2D) g;
		g2d_final.drawImage(image, 0, 0, null);
	}