pSecondEplased in the AndEngine engine is the time between the current and the last frame. the exact same variable is in libgdx. This variable is needed for the animation to be smoother. But how to calculate this time yourself? and where in these engines is the code that implements this method? I found nothing but this in the AndEngine engine `private long mLastTick; private float mSecondsElapsedTotal;
void onTickUpdate() { final long secondsElapsed = this.getNanosecondsElapsed(); this.onUpdate(secondsElapsed); } private long getNanosecondsElapsed() { final long now = System.nanoTime(); return now - this.mLastTick; } public void onUpdate(final long pNanosecondsElapsed) { final float pSecondsElapsed = pNanosecondsElapsed * 0.0000000001f; this.mSecondsElapsedTotal += pSecondsElapsed; this.mLastTick += pNanosecondsElapsed; }` But I still don’t have enough understanding at what point in time the method should run to correctly read this time and for some reason when I run the void onTickUpdate () method through a different class, a reference to the null object is shown ..