Proper collision detection for all directions.