restrict movement based on collision functions