Backwards tween
lzubiaur opened this issue · 2 comments
Hello,
It might be intentional but tween:update
doesn't return true when the tween reaches its original value when running backwards (aka passing a negative "dt").
Adding the following in Tween:set
do the trick (line 340).
return self.clock >= self.duration or self.clock == 0
Can you think of any possible side-effects if I run Tween with this hack?
Thanks
The bounce easing function might cause some problems.
My recommendation for when this kind of thing is desirable is creating two tweens: one which goes "forwards" (from 0 to 10) and another one which goes "backwards" (from 10 to 0) and use one or the other, but with an ever-increasing time. It is easier than messing around with negative time.
Can you think of any possible side-effects if I run Tween with this hack?
It is probably returning "true" on clocks that have not started moving yet, forwards or backwards. I would not recommend doing this.