Hey everyone,
Apologies if this has been explained elsewhere. I have a sprite that moves from left to right when an object is clicked with the mouse. I've got that working perfectly, using the custom movement behaviour.
And that looks like this: https://twitter.com/i/status/1135289518083514371
What I want to add is a smooth motion to the sprite (acceleration and deceleration). I think I'm on the right track using lerp, but just can't work it out!
The easiest way to do this is with MoveTo behavior:
construct.net/en/forum/extending-construct-2/addons-29/behavior-moveto-40701
Develop games in your browser. Powerful, performant & highly capable.
Ah, cool. Thank you so much for that.
Is there any way to do it without using a plug-in. I figure it'd be good to learn!
idlephononautica
without a plugin, Lerp might be the best option - but like you found out, it can be tricky to get what you want. You could also try bullet behavior - that allows acceleration/deacceleration.
otherwise, litetween is how I would do it.
https://www.construct.net/en/forum/extending-construct-2/addons-29/behavior-litetween-48240?kws=litetween
if you ever move up to C3, it has a native tween feature...
ah, sure. It was more out of interest really. I used that plugin recommended above and it works a treat. (Thanks dop2000.
I haven't done my research into moving to C3 yet. I should though!