+ 3
Why do the balls don't bounce separately , when a ball bounce all of the other balls bounce too
https://code.sololearn.com/WkP0qqKsF8cw/?ref=app sorry for the bad code writing I'm still a newbie for coding
4 Answers
+ 4
The key for the solution is
this.vx = 1
this.vy = 1
https://code.sololearn.com/WK6oTC8TN69y/?ref=app
+ 1
Mohammad _io_ and also add some styles to get nice effect
*{
margin:0;
padding:0;
box-sizing:border-box ;
}
+ 1
Thank you JaScript. now I understand why
0
HrCoder thanks