summaryrefslogtreecommitdiff
path: root/src/sliceitoff/player/player.py
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-18 13:05:58 +0200
committerViljami Ilola <+@hix.fi>2024-03-18 13:05:58 +0200
commitb00fe8fe50392a75529864fe03399fa3a0976143 (patch)
tree4f61dbc5b771605984bb3c34d0b8a423c8a8c24c /src/sliceitoff/player/player.py
parent8781f3b04dff7434d302f7606cdcb0d2c1523cf8 (diff)
internal resolution x10. get rid of rest get_sprites functions
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r--src/sliceitoff/player/player.py12
1 files changed, 4 insertions, 8 deletions
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