+ 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

7th Sep 2021, 3:40 PM
Mohammad _io_
4 Réponses
+ 4
The key for the solution is this.vx = 1 this.vy = 1 https://code.sololearn.com/WK6oTC8TN69y/?ref=app
7th Sep 2021, 4:56 PM
JaScript
JaScript - avatar
+ 1
Mohammad _io_ and also add some styles to get nice effect *{ margin:0; padding:0; box-sizing:border-box ; }
7th Sep 2021, 5:01 PM
Pariket Thakur
Pariket Thakur - avatar
+ 1
Thank you JaScript. now I understand why
7th Sep 2021, 5:05 PM
Mohammad _io_
0
HrCoder thanks
7th Sep 2021, 5:14 PM
Mohammad _io_