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/player/player.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'src/sliceitoff/player') diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py index f383077..9870c50 100644 --- a/src/sliceitoff/player/player.py +++ b/src/sliceitoff/player/player.py @@ -17,7 +17,7 @@ class Player(): def __init__(self, field = None, enemies = None): self.field = field self.enemies = enemies - self.position = (20_000, 14_000) + self.position = (200_000, 140_000) self.direction = False self.lazer = False self.sprites = pygame.sprite.Group() @@ -39,15 +39,15 @@ class Player(): self.position = Scaling.scale_to_internal(pos) self.updated = True - def get_sprites(self): + def update(self, dt): + """ Update sprites basis of dt. dt = milliseconds from last update """ if self.updated: self.__update_sprites() - return self.sprites def fire_lazer(self): # self.lazer = True # self.updated = True - hitbox = self.field.slice(self.position, self.direction, 450) + hitbox = self.field.slice(self.position, self.direction, 4_500) if hitbox is not None: for enemy in self.enemies.sprites: if hitbox.colliderect(enemy.rect): @@ -64,7 +64,3 @@ class Player(): if not self.lazer: self.direction = not self.direction self.updated = True - - def __del__(self): - pass - \ No newline at end of file -- cgit v1.2.3