@Override
	public void run() {
		long lastTime = System.nanoTime();
		double nsPerTick = 1000000000D/64D;
		
		int ticks = 0;
		int frames = 0;
		
		long lasTimer = System.currentTimeMillis();
		double delta = 0;
		
		init();
		
		while(running){
			long now = System.nanoTime();
			delta += (now - lastTime) / nsPerTick;
			lastTime = now;
			boolean shouldRender = true;
			
			while(delta >= 1){
				ticks++;
				update();
				delta -= 1;
				shouldRender = true;
			}
			
			try {
				Thread.sleep(2);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			if(shouldRender){
				frames++;
				render();
			}
			
			if(System.currentTimeMillis() - lasTimer >= 1000){
				lasTimer += 1000;
				System.out.println(frames + " FPS, " + ticks + " UPS || Player X/Y: " + player.x + "/" + player.y);
				frames = 0;
				ticks = 0;
			}
		}
		stop();
	}