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

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

		if (state == STATE.GAME) {
			screen.clear();
			double xScroll = player.getX() - screen.width / 2;
			double yScroll = player.getY() - screen.height / 2;
			level.render((int) xScroll, (int) yScroll, screen);
			if (player != null && player.getHUD() != null) {
				player.getHUD().render(screen, g);
			}
			for (int i = 0; i < pixels.length; i++) {
				pixels[i] = screen.pixels[i];
			}
			g.setColor(Color.WHITE);
		} else if (state == STATE.MENU) {
			menu.render(screen);
			for (int i = 0; i < pixels.length; i++) {
				pixels[i] = screen.pixels[i];
			}
		}

		else if (state == STATE.PAUSED) {
			paused.render(g);
		}

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