Does anyone know what the best method is to scroll the screen along by its own width, using acceleration and deceleration?
I've tried lerp but that only produces the effect of deceleration, of course.
Develop games in your browser. Powerful, performant & highly capable.
What I use is a small invisible sprite (10x10) called 'scroller'.
Add Scroll-to and Tween behaviors to it.
Then, whenever you need to scroll, use Tween to that sprite with Ease (e.g. In Out Quadratic).
On touch start -> set variable acc to 6
Is in touch -> scroll to lerp (scrollx, touch.x,acc*dt)
-> set acc to lerp(acc,1,mydecelerationspeed*dt)
Worked a treat, thanks so much El Constructorr!
And thanks for helping too newt :)