Hi everyone | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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 Resposta
+ 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