It keeps an anim (the second) within a given boundary... which
probably doesn't make things any clearer for you.
Notice how `wrap` is used in the link you sent: (reformatted to see
the arguments easier, and I took out the rand stuff)
s.x = wrap(
[-400,400],
lerp(0, 400, dt=4, extend="extrapolate")
)
The lerp goes on infinitely. If you assigned the lerp directly to
s.x, the sprites would go off the the screen after four seconds.
Using wrap makes them wrap around to the other side.
Wrapping with the bounds [0, 400] converts the value like this:
20 => 20
400 => 400
401 => 1
430 => 30
810 => 10
-1 => 399
Hope that makes sense now :-)
MWM
On Dec 30, 7:09 pm, Matthew Marshall <matt...@matthewmarshall.org>
wrote: