From b03cb075e7a2042764a355a46d649b187f66343b Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Sat, 23 Mar 2024 18:42:26 +0200 Subject: Field as sprite group. --- src/sliceitoff/enemies/enemies.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/sliceitoff/enemies') 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) -- cgit v1.2.3