def contact(self, player: sprite.Sprite): """Detect collision between player and enemy polygons and reduce their hull. player: player sprite""" for enemy in sprite.spritecollide(player, self, False, sprite.collide_circle): player.knockback(enemy) enemy.damage() player.damage()
def harm(self, player: sprite.Sprite): """Detect collision between player and enemy fire and reduce hull. player: player sprite""" for _ in sprite.spritecollide(player, self, True, sprite.collide_circle): player.damage()