added code to update score when collisiondetection is true