I think this is what you are looking for. I took out the bullet behavior, but i think it will work with it too. It will show you the total Distance Travelled for your object.
I see I forgot to put in two lines of code to reset the OldX and OldY when the object is remade after it goes out of the layout. It work fine untill you go out of the layout.