From 505ca2dead48d80b15f64f316218502bdc54daea Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Fri, 29 Mar 2024 14:53:59 +0200 Subject: Enemies to use update --- src/sliceitoff/field/field.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sliceitoff/field') 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 -- cgit v1.2.3