Added collision detection between player and obstacles.