From b00fe8fe50392a75529864fe03399fa3a0976143 Mon Sep 17 00:00:00 2001 From: Viljami Ilola <+@hix.fi> Date: Mon, 18 Mar 2024 13:05:58 +0200 Subject: internal resolution x10. get rid of rest get_sprites functions --- src/sliceitoff/enemies/enemies.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/sliceitoff/enemies') 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 -- cgit v1.2.3