diff options
Diffstat (limited to 'src/sliceitoff/enemies/enemies.py')
-rw-r--r-- | src/sliceitoff/enemies/enemies.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sliceitoff/enemies/enemies.py b/src/sliceitoff/enemies/enemies.py index b0ac187..6a9fda4 100644 --- a/src/sliceitoff/enemies/enemies.py +++ b/src/sliceitoff/enemies/enemies.py @@ -56,8 +56,8 @@ class Enemies(): def emerge_enemies(self): for _ in range(self.level * 1): enemy = EnemyBall() - enemy.set_position( (randrange(0,38_000), randrange(0,26_000)) ) - enemy.set_movement( (randrange(0,400)-200, randrange(0,400)-200) ) + enemy.set_position( (randrange(0,380_000), randrange(0,260_000)) ) + enemy.set_movement( (randrange(0,200)-100, randrange(0,200)-100) ) self.sprites.add(enemy) def wall_hit(self, field, enemy): @@ -70,8 +70,9 @@ class Enemies(): if ( enemy.rect.y + enemy.rect.h >= field.rect.y + field.rect.h ): enemy.force_up() - def get_sprites(self): - self.sprites.update(move=1) + def update(self, dt): + """ 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: if field.rect.contains(enemy): @@ -80,5 +81,3 @@ class Enemies(): for field in self.field.sprites: if field.rect.colliderect(enemy): self.wall_hit(field, enemy) - - return self.sprites |