public void startGame() throws InterruptedException {
		canvas.createBufferStrategy(2);
		
		Graphics2D g = (Graphics2D)canvas.getBufferStrategy().getDrawGraphics();
		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
		
		long start = 0L;
		long sleepDuration = 0L;
		
		while(true) {
			start = System.currentTimeMillis();

			update();
			render(g);

			canvas.getBufferStrategy().show();

			g.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());
			
			sleepDuration = (1000L / UPDATES_PER_SECOND) - (System.currentTimeMillis() - start);

			if (sleepDuration > 0) {
				try {
					Thread.sleep(sleepDuration);
				} catch(Exception e) {
					e.printStackTrace();
				}
			}
		}
	}