Skip to content

Commit

Permalink
rename 'crashed' dictionary of collided_sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
MyreMylar authored Dec 31, 2024
1 parent 1307e2e commit 8a8b7af
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src_py/sprite.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,18 +1719,18 @@ def groupcollide(groupa, groupb, dokilla, dokillb, collided=None):
that will be used to calculate the collision.
"""
crashed = {}
collided_sprites = {}
# pull the collision function in as a local variable outside
# the loop as this makes the loop run faster
sprite_collide_func = spritecollide
for group_a_sprite in groupa:
collisions = sprite_collide_func(group_a_sprite, groupb, dokillb, collided)
if collisions:
crashed[group_a_sprite] = collisions
collided_sprites[group_a_sprite] = collisions
if dokilla:
for group_a_sprite in crashed:
for group_a_sprite in collided_sprites:
group_a_sprite.kill()
return crashed
return collided_sprites


def spritecollideany(sprite, group, collided=None):
Expand Down

0 comments on commit 8a8b7af

Please sign in to comment.