private void gameLoop() {
		long lastTime = System.nanoTime();
		long timer = System.currentTimeMillis();
		final double ns = 1000000000.0 / 60.0;
		double delta = 0;
		int frames = 0;
		int updates = 0;
		
		gameMap = new Map();
		
		while (gameRunning) {
			long now = System.nanoTime();
			delta += (now - lastTime) / ns;
			lastTime = now;
			if (delta >= 1) {
				
				if (Keyboard.isKeyDown(Keyboard.KEY_LEFT))
					offsetX-=10;
				if (Keyboard.isKeyDown(Keyboard.KEY_RIGHT))
					offsetX+=10;
				if (Keyboard.isKeyDown(Keyboard.KEY_UP))
					offsetY-=10;
				if (Keyboard.isKeyDown(Keyboard.KEY_DOWN))
					offsetY+=10;
				updates++;
				delta--;
			}
			
			renderGraphics();
			frames++;

			if (System.currentTimeMillis() - timer > 1000) {
				timer += 1000;
				setTitle(title + "  |  " + updates + " ups, " + frames + " fps");
				updates = 0;
				frames = 0;
			}
			
			
			if(Display.isCloseRequested() || Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
				gameRunning = false;
				Display.destroy();
				callback.windowClosed();
			}
		}
	}