summaryrefslogtreecommitdiff
path: root/src/sliceitoff/field/field.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-29 14:53:59 +0200
committerViljami Ilola <+@hix.fi>2024-03-29 14:53:59 +0200
commit505ca2dead48d80b15f64f316218502bdc54daea (patch)
tree39f6e1e730b01472c72a412c693472e36d21180b /src/sliceitoff/field/field.py
parentc75093304fb09dcdee61ea36169074828b1e210d (diff)
Enemies to use update
Diffstat (limited to 'src/sliceitoff/field/field.py')
-rw-r--r--src/sliceitoff/field/field.py4
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