+ 1
Squares question
How to make them change thier way every time they hit each others??! https://code.sololearn.com/Wj3GeyLAwL7i/?ref=app
1 Odpowiedź
+ 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)