diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-16 22:31:17 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-16 22:31:17 +0200 |
commit | 2e3a09a64f424fa2ead7d35ebcc24034de8b3586 (patch) | |
tree | cf40425c68e11acab806776efd3caa38c6dcee25 | |
parent | 4050057c34c67130cf5f1d202ca85cb81985f968 (diff) |
remove unused code
-rw-r--r-- | src/sliceitoff/__main__.py | 2 | ||||
-rw-r--r-- | src/sliceitoff/enemies/enemies.py | 2 | ||||
-rw-r--r-- | src/sliceitoff/field/field.py | 11 | ||||
-rw-r--r-- | src/sliceitoff/player/player.py | 2 |
4 files changed, 3 insertions, 14 deletions
diff --git a/src/sliceitoff/__main__.py b/src/sliceitoff/__main__.py index 347d78e..df4ba22 100644 --- a/src/sliceitoff/__main__.py +++ b/src/sliceitoff/__main__.py @@ -25,7 +25,7 @@ def sliceitoff(): status = Status() field = Field() - enemies = Enemies(field = field, level = 2) + enemies = Enemies(field = field, level = 10) player = Player(field = field, enemies = enemies) game = Game(player = player) diff --git a/src/sliceitoff/enemies/enemies.py b/src/sliceitoff/enemies/enemies.py index bed4a86..b0ac187 100644 --- a/src/sliceitoff/enemies/enemies.py +++ b/src/sliceitoff/enemies/enemies.py @@ -54,7 +54,7 @@ class Enemies(): self.field = field def emerge_enemies(self): - for _ in range(self.level * 3): + 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) ) diff --git a/src/sliceitoff/field/field.py b/src/sliceitoff/field/field.py index c0c482d..c89ecdf 100644 --- a/src/sliceitoff/field/field.py +++ b/src/sliceitoff/field/field.py @@ -17,9 +17,7 @@ class FieldSprite(pygame.sprite.Sprite): class Field(): def __init__(self): self.sprites = pygame.sprite.Group() -# self.updated = True self.sprites.add(FieldSprite( (0, 0, 40_000, 28_000) )) -# self.areas = [(0,0,40_000,28_000)] def coordinates_inside_area(self, area, x, y) -> bool: if x < area[0]: @@ -47,7 +45,6 @@ class Field(): field.remove(self.sprites) # create new areas if there is any space -# self.updated = True if direction: x1 = ax @@ -71,16 +68,8 @@ class Field(): self.sprites.add(FieldSprite( (ax, y3, aw, y4-y3) )) return Scaling.area_to_rect((ax, y2, aw, y3-y2)) - def __update_sprites(self): - """""" -# self.sprites.empty() -# for area in self.areas: -# self.sprites.add(FieldSprite(Scaling.area_to_rect(area))) -# self.updated = False def get_sprites(self) -> pygame.sprite.Group: -# if self.updated: -# self.__update_sprites() return self.sprites def __del__(self): diff --git a/src/sliceitoff/player/player.py b/src/sliceitoff/player/player.py index a7d2b63..f383077 100644 --- a/src/sliceitoff/player/player.py +++ b/src/sliceitoff/player/player.py @@ -47,7 +47,7 @@ class Player(): def fire_lazer(self): # self.lazer = True # self.updated = True - hitbox = self.field.slice(self.position, self.direction, 1_000) + hitbox = self.field.slice(self.position, self.direction, 450) if hitbox is not None: for enemy in self.enemies.sprites: if hitbox.colliderect(enemy.rect): |