       top: []
       bottom: []
 
+    adjacent =
+      left: null
+      right: null
+      top: null
+      bottom: null
+
     # Apply & restrict VERTICAL movement
     box.moveY(vy * @dt())
 

    hitBoxJS.touching.bottom = hits.bottom.length > 0
    hitBoxJS.touchingSomething = hitBoxJS.touching.left or hitBoxJS.touching.right or hitBoxJS.touching.top or hitBoxJS.touching.bottom

    @updateComp hitBox.merge(hitBoxJS)

    # Update velocity if needed based on running into objects:

    if hits.top.length > 0
      s = hits.top[0]
      box.setY(s.y+s.height - box.topOffset)
      adjacent.top = hits.top
    else
      hits.bottom = tileSearchHorizontal(grid, tileWidth,tileHeight,Math.ceil(box.bottom), box.left, box.right-1)
      if hits.bottom.length > 0
        s = hits.bottom[0]
        box.setY(s.y - box.bottomOffset-1)
        adjacent.bottom = hits.bottom

    unless adjacent.top?
      adjacent.top = tileSearchHorizontal(grid, tileWidth,tileHeight, box.top-1, box.left, box.right-1)
    unless adjacent.bottom?
      adjacent.bottom = tileSearchHorizontal(grid, tileWidth,tileHeight,Math.ceil(box.bottom+1), box.left, box.right-1)


    # Step 2: apply & restrict horizontal movement
    box.moveX(vx * @dt())
