diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-31 10:51:03 +0300 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-31 10:51:03 +0300 |
commit | 1a4422be08ef234ed0666f13b13fc03506c197b3 (patch) | |
tree | ecd98ba534abcfaeae3d729f9040b36ffa3c6026 /src/sliceitoff/enemies | |
parent | af17f92e0beda893fb91ff757b76f2499e500666 (diff) |
python 3.10 and proper version number + lint
Diffstat (limited to 'src/sliceitoff/enemies')
-rw-r--r-- | src/sliceitoff/enemies/enemies.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sliceitoff/enemies/enemies.py b/src/sliceitoff/enemies/enemies.py index c52059f..ee8109b 100644 --- a/src/sliceitoff/enemies/enemies.py +++ b/src/sliceitoff/enemies/enemies.py @@ -1,3 +1,4 @@ +""" enemies.enemies - group for enemies for the leve""" from random import randrange import pygame @@ -5,7 +6,8 @@ from .ball import EnemyBall from .bouncher import EnemyBouncher class Enemies(pygame.sprite.Group): - def __init__(self, field = None, count = 0): + """ Init with count. Randomizing enemy types. Some are worth more. """ + def __init__(self, count = 0): super().__init__() while count: match randrange(0,4): @@ -17,9 +19,8 @@ class Enemies(pygame.sprite.Group): if count >= 2: self.add(EnemyBouncher()) count -= 2 - self.field = field - def update(self, field_rects = [], **kwargs): + def update(self, field_rects = None, **kwargs): """ Do actions on enemies that are only partly on the fields """ super().update(**kwargs) for enemy in self.sprites(): |