+ 1

Hi everyone

why the cube is teleporting instead of moving? https://code.sololearn.com/Wg5Y7zf6a2lP/?ref=app

15th Oct 2017, 6:29 PM
😎_M_😎
😎_M_😎 - avatar
1 Odpowiedź
+ 4
you should move the rect during every frame with a speed variable that depends on the position and distance between your finger and the rect itself. Better accomplished with vectors as you'll need both x, y components (direction) and magnitude (speed).
16th Oct 2017, 12:05 AM
seamiki
seamiki - avatar