diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-29 14:53:59 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-29 14:53:59 +0200 |
commit | 505ca2dead48d80b15f64f316218502bdc54daea (patch) | |
tree | 39f6e1e730b01472c72a412c693472e36d21180b /src/sliceitoff/field | |
parent | c75093304fb09dcdee61ea36169074828b1e210d (diff) |
Enemies to use update
Diffstat (limited to 'src/sliceitoff/field')
-rw-r--r-- | src/sliceitoff/field/field.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/sliceitoff/field/field.py b/src/sliceitoff/field/field.py index 6baf966..a062159 100644 --- a/src/sliceitoff/field/field.py +++ b/src/sliceitoff/field/field.py @@ -114,6 +114,10 @@ class Field(pygame.sprite.LayeredUpdates): def active_sprites(self): """ Returns all sprites that are not dead """ return [s for s in self.sprites() if not s.dead] + + def active_rects(self): + """ Returns active areas as rects """ + return [s.rect for s in self.sprites() if not s.dead] def explode(self, area): sx, sy, w, h = area |