public GamePanel() {
		setBorder(null);
		Dimension size = new Dimension(WIDTH * 2, HEIGHT * 2);
		setPreferredSize(size);
		setFocusable(true);
		requestFocus();
		addKeyListener(this);
		image = new BufferedImage(WIDTH, HEIGHT, BufferedImage.TYPE_INT_RGB);
		graphics = (Graphics2D) image.getGraphics();
		stageManager = new StageManager(this, StageManager.STAGE_WELCOME);
		new Thread(new Runnable() {
			public void run() {
				long startTime = 0;
				long delay = 0;
				long waitTime = 1000 / FPS_MAX;

				long lastTime = 0;
				long time = 0;

				while (true) {
					time = System.nanoTime();
					fps = (int) (1000000000d / (time - lastTime));
					lastTime = time;
					startTime = System.currentTimeMillis();
					draw(graphics);
					delay = waitTime - (System.currentTimeMillis() - startTime);
					if (delay > 0) {
						try {
							Thread.sleep(delay);
						} catch (InterruptedException e) {
							e.printStackTrace();
						}
					}
				}
			}
		}).start();
	}