private void render() {
	BufferStrategy bs = getBufferStrategy();
	if (bs == null) {
	    createBufferStrategy(3);
	    return;
	}

	screen.clear();

	xScroll = (int) ((Mob) player).getX() - WIDTH / 2 + 16;
	yScroll = (int) ((Mob) player).getY() - HEIGHT / 2 + 16;

	if (xScroll < 0) {
	    xScroll = 0;
	}
	if (yScroll < 0) {
	    yScroll = 0;
	}
	if (xScroll > level.getLevelWidth() - WIDTH) {
	    xScroll = level.getLevelWidth() - WIDTH;
	}
	if (yScroll > level.getLevelHeight() - HEIGHT) {
	    yScroll = level.getLevelHeight() - HEIGHT;
	}

	g = bs.getDrawGraphics();
	g.drawImage(image, 0, 0, getWidth(), getHeight(), null);

	level.renderMap(xScroll, yScroll, screen);
	level.renderEntities(screen);

	for (int i = 0; i < pixels.length; i++) {
	    pixels[i] = screen.pixels[i];
	}

	screen.renderBar(10, 10, g);

	if (key.pause) {
	    Color mask = new Color(0x99000000, true);
	    g.setColor(mask);
	    g.fillRect(0, 0, Game.getWindowWidth(), Game.getWindowHeight());

	    g.setColor(Color.white);
	    g.setFont(new Font("Arial", Font.PLAIN, 20));

	    g.drawString("PAUSE", Game.getWindowWidth() / 2 - 40, Game.getWindowHeight() / 2 - 10);
	}

	g.dispose();
	bs.show();

    }