True !
Yes
It IS comparing every cell with every other cell:
def interact(self):
#Check every other cells
for a in collection:
if a is not self:
#Distance between other cells
d = dist(a.x(), a.y(), self.x(), self.y())
if d < (a.radius + self.radius):
### Push other cells outside its perimeter ###
#Direction
dir = PVector.sub(PVector(self.x(), self.y()), PVector(a.x(), a.y()))
dis = dir.magSq()
dis = constrain(dis, 10, (self.radius + a.radius))
dir.normalize()
#Magnitude
m = (self.mass * a.mass) / dis
#Combining magnitude and direction
dir.mult(-m)
#Converting to Vec2D + adding force to physics engine
dir = Vec2D(dir.x, dir.y)
a.addForce(dir)