@Override
	public void run() {

		init();

		while (true) {
			update();
			draw();
			draw2Screen();
			elapsed = System.nanoTime() - start;
			wait = targetTime - elapsed / 1000000;

			if (wait < 0)
				wait = 5;
			try {
				Thread.sleep(wait);
			} catch (InterruptedException ex) {
				Logger.getLogger(GamePanel.class.getName()).log(Level.SEVERE,
						null, ex);
			}
		}
	}