diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-18 19:55:32 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-18 19:55:32 +0200 |
commit | d19b06f7728df38dd4cfe770615c969b49f9e227 (patch) | |
tree | 11643a416d6fce0e73edf3cb262b84caa615fe30 /src/sliceitoff/player/player.py | |
parent | 78704848d4459907a456044615714b59d4593b2f (diff) |
gameplay refactoring
Diffstat (limited to 'src/sliceitoff/player/player.py')
-rw-r--r-- | src/sliceitoff/player/player.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py index 241897d..2f4ce57 100644 --- a/src/sliceitoff/player/player.py +++ b/src/sliceitoff/player/player.py @@ -4,6 +4,8 @@ import pygame from display import Scaling from images import Images +DEBUG = os.getenv("DEBUG") + class PlayerSprite(pygame.sprite.Sprite): def __init__(self, image, pos): super().__init__() @@ -45,6 +47,8 @@ class Player(): self.__update_sprites() def fire_lazer(self): + if DEBUG: + print("PLAYER: fire lazer") # self.lazer = True # self.updated = True hitbox = self.field.slice(self.position, self.direction, 4_500) @@ -53,7 +57,7 @@ class Player(): for enemy in self.enemies.sprites: if hitbox.colliderect(enemy.rect): hit = True - break; + break for field in self.field.sprites: for enemy in self.enemies.sprites: if enemy.rect.colliderect(field.rect): |