wall detection function
don't allow turning into a wall