Add collision detection and handling in physics.c