Tweet

Replying to @stysmmaker

This is now After Effects code golf
x=y=150;q=c=0;l=[[x,-y],[-x,-y],[-x,y],[x,y]];c=(c!=1?l.length-1:0);t=time/.5;function g(i,a=c){return Math.abs(a-(Math.floor(t)+Math.round(c+i+q))%l.length)}
value+linear(t%1,0,1,l[g(0)],l[g(1)])

(original)