rewrite collision function of Ball