If a collision occurs, is there a way to get both objects?
For example:
allSprite = pygame.sprite.Group()
Bullets = pygame.sprite.Group()
Enemies = pygame.sprite.Group()
bullet = Bullet()
enemy = Enemy()
Bullets.add(bullet)
Enemies.add(enemy)
hits = pygame.sprite.collide(Enemies,Bullets)
for hit in hits:
hit.damage()
This only gets the Enemy
object, but I want both objects because I need the bullet damage, too.