 
 square = (x) -> x * x
 
+pushOther = (entity, other) ->
+  [entPos, entBlob] = [entity.c('pos'), entity.c('blob')]
+  [otherPos, otherBlob] = [other.c('pos'), other.c('blob')]
+  # Run away from the other
+  direction = Math.atan2 entPos.y - otherPos.y, entPos.x - otherPos.x
+  vel = 1
+  velX = vel * Math.cos direction
+  velY = vel * Math.sin direction
+  entBlob.velX += velX
+  entBlob.velY += velY
+  otherBlob.velX -= velX
+  otherBlob.velY -= velY
+
 BlobSystem =
   priority: 1500
   onAddedToEngine: (engine) ->

  update: (delta) ->
    for entity, i in @entities
      [entPos, entBlob] = [entity.c('pos'), entity.c('blob')]
      entPos.x += entBlob.velX / 1000 * delta
      entPos.y += entBlob.velY / 1000 * delta
      entBlob.velX *= Math.pow 0.994, 1 / 32 * delta

BlobSplitAction = Action.scaffold (engine) ->
  entPos = @entity.c 'pos'
  entBlob = @entity.c 'blob'
  entBlob.weight = entBlob.weightCap if entBlob.weightCap
  weight = entBlob.weight / 2
  direction = Math.random() * Math.PI * 2
  vel = 3 * Math.sqrt weight
