Bond with the nearest ball.
https://codepen.io/-bloop-/pen/jOeJzqr
in this given codepen, u can see there's 30 balls each with their respective x and y velocity.
the intention of the code was to make so that each ball forms a bond with it's nearest ball. But apart from the first ball, all of the balls don't actually create a bond with it's nearest one unless a ball is very very close to it. Does anyone how why it happens or how I can tackle this?
I've added descriptive comments in my code so it'll be easier to understand what each codeblock does. tnx ❤️
2 Replies