diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-23 18:42:26 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-23 18:42:26 +0200 |
commit | b03cb075e7a2042764a355a46d649b187f66343b (patch) | |
tree | f78e991650d33f7b1d9d8eab60f1e045da92d6c1 /src/sliceitoff/enemies | |
parent | 975e5dca49fb09fe2f762462f1c337c0d63735bf (diff) |
Field as sprite group.
Diffstat (limited to 'src/sliceitoff/enemies')
-rw-r--r-- | src/sliceitoff/enemies/enemies.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/sliceitoff/enemies/enemies.py b/src/sliceitoff/enemies/enemies.py index d9ba59a..a3a60a0 100644 --- a/src/sliceitoff/enemies/enemies.py +++ b/src/sliceitoff/enemies/enemies.py @@ -55,7 +55,7 @@ class Enemies(): def emerge_enemies(self): for _ in range(3 + (Stats.level-1) * 2): enemy = EnemyBall() - enemy.set_position( (randrange(0,380_000), randrange(0,260_000)) ) + enemy.set_position( (randrange(0,300_000), randrange(0,200_000)) ) enemy.set_movement( (randrange(0,200)-100, randrange(0,200)-100) ) self.sprites.add(enemy) @@ -73,10 +73,10 @@ class Enemies(): """ Update sprites basis of dt. dt = milliseconds from last update """ self.sprites.update(move=dt) for enemy in self.sprites: - for field in self.field.sprites: + for field in self.field.sprites(): if field.rect.contains(enemy): break else: - for field in self.field.sprites: + for field in self.field.sprites(): if field.rect.colliderect(enemy): self.wall_hit(field, enemy) |