implements direction collision, lastMovingDirection, fixed passable bugs,