Squares question | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Squares question

How to make them change thier way every time they hit each others??! https://code.sololearn.com/Wj3GeyLAwL7i/?ref=app

7th May 2018, 2:14 PM
Thamer T
Thamer T - avatar
1 Answer
+ 6
Something you can start working with. :> function test_collide() { if (Math.abs(a-x) < 50 && Math.abs(b-y) < 50) { da=-da db=-db dx=-dx dy=-dy } } setInterval(test_collide, 50)
7th May 2018, 2:30 PM
Hatsy Rei
Hatsy Rei - avatar