Help thinking out an attraction behavior

I’m wondering if you could help me with this particular (no pun : ) aspect of the code. His update() code directly accsses the global ArrayList, swarm, inside one of it’s methods. I thought that would not be a good practice, but indeed it makes things easier. Should I worry about this approach?

As I gonna have some unique particles, I’ll need to have an array (i’m in js) holding only one? Well not really sure how i will do things yet, but this makes a worse modularity? Right? (not a rethorical ‘right?’ : )

Read more here: Source link