 #    collision::bool true if collision
 #    timeStart::int first generation, where interaction has started
 #    products::[ ProductDesc ]  list of collision products (patterns with their positions and classification
-doCollision = (rule, p1, v1, p2, v2, offset, startDist = 30, collisionTreshold=20)->
+doCollision = (rule, p1, v1, p2, v2, offset, initialSeparation = 30, collisionTreshold=20)->
   waitForCollision = v1[2] + v2[2] #sum of periods
   params = collisionParameters [0,0,0], v1, offset, v2  
-  ap = approachParameters [0,0,0], v1, offset, v2, startDist
+  ap = approachParameters [0,0,0], v1, offset, v2, initialSeparation
   collision = {collision:false}
   if not ap.approach
     #console.log "#### No approach, nearest approach: #{params.dist}"

  Cells.to_rle ff
  

# Collide 2 patterns: p1 and p2,
#    p1 at [0,0,0] and p2 at `offset`.
#    startDist::int average initial distance to put patterns at. Should be large enought for patterns not to intersect
#    collisionTreshold:: if patterns don't come closer than this distance, don't consider them colliding.
#    waitForCollision::int How many generations to wait after the approximate nearest approach, until the interaction would start.
#

  #console.log "#### AP: #{JSON.stringify ap}"
  
  #Create the initial field. Put 2 patterns: p1 and p2 at initial time 
  #nwo promote them to the same time, using list evaluation
  time = Math.max ap.npos0[2], ap.npos1[2]
  fld1 = patternAtTime rule, p1, ap.npos0, time
  fld2 = patternAtTime rule, p2, ap.npos1, time
  
  #OK, collision prepared. Now simulate both spaceships separately and
  # together, waiting while interaction occurs
  timeGiveUp = params.tcoll + waitForCollision #when to stop waiting for some interaction
