fixed motion of ball when colliding with walls