Agar.io nvansansdot in Snap!

It's currently far from finished.

"nvansansdot" is short for "no viruses and no splitting and no size decrease over time".

I have a working version on Scratch here.

I need help with collision.

This is my attempt (an old version) : project

I still have to integrate the multi-player option

what kind of help?

I want an efficient (in this case anything less than O(n), though preferably around O(logxn)) collision detection algorithm that takes a list of circles (of arbitrary sizes, with arbitrary positions) and another circle and gives a list of all the circles in the list that intersect with the given circle. Also, circles are represented as (position radius), where position is a list of x and y--(x y).

There is a collision when: distance between (center) circle 1 and circle 2 is less than r1+r2

you can map all the distance from the player and all particle and keep the colliding ones.

Personnally, i suggest you to use 1 sprite for the player and somes clones for the particles and test with the "is touching" block with "my neighbors" (only particle neighbors)

Yes, I know how circle collision works.

That made me realize I don't need to check for collision between each pair of things, just the player and everything else.

This is a 100% pen project, so that won't work.

particles, other players, bonus (?)

What do you mean there?

I simply mean that you must know the nature of the object (not everything) with which you collide.

Everything it would collide with is a circle, stored as ((x y) r).