@name 
@inputs Go      
@outputs Tdif PosDif:vector Pdif:vector Vo:vector Vf:vector
@persist Start Po:vector Pf:vector T1 T2
@trigger all
runOnTick(1)

if (Start == 2) {
    Po = entity():pos()
    Vo = entity():vel()
    entity():applyForce(vec(100/0.015,0,0))
    Vf = entity():vel()
    Po2 = entity():pos()
    Pdif = Po - Po2
    T1 = curtime()
} 
if (Start == 1) {
    Start = 0
    Pf = entity():pos()
    entity():applyForce(vec(-100/0.015,0,0))
    T2 = curtime()
}

PosDif = (Pf - Po)*100
Tdif = T2-T1

if (Start>0) {
    Start--
}
if (~Go&Go==1) {
    Start = 2
}
