Extracted movement/collision/merge logic to one function and implemented for all directions