def handle_collision(self, rat): rat.change_direction(self)
def handle_collision(self, rat): #change_direction() returns either True or False depending on if the rat changed direction. Only decrease hits_left if rat changed direction if rat.change_direction(self): self.hits_left -= 1 if self.hits_left <= 0: self.delete()