nit: } else {

What about moving x0, t0, x1, t1 declarations out of getDeltaX and so you will be able to remove lastMoveEvent and use x1/t1 instead.

x0 = x1;
t0 = t1;