summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViljami Ilola <+@hix.fi>2024-03-18 12:48:55 +0200
committerViljami Ilola <+@hix.fi>2024-03-18 12:48:55 +0200
commit8781f3b04dff7434d302f7606cdcb0d2c1523cf8 (patch)
tree7b465dd7b5f05c6872de9e0cbfcc3627fb1a45d8
parent6eff6d1d8779480c5fb56a9b7fa619209da45423 (diff)
field -> no get_sprites, separate update
-rw-r--r--src/sliceitoff/__main__.py4
-rw-r--r--src/sliceitoff/field/field.py7
2 files changed, 3 insertions, 8 deletions
diff --git a/src/sliceitoff/__main__.py b/src/sliceitoff/__main__.py
index 68fca86..5fc766b 100644
--- a/src/sliceitoff/__main__.py
+++ b/src/sliceitoff/__main__.py
@@ -35,13 +35,13 @@ def sliceitoff():
while True:
dt = clock.tick(60)
- for fun in (status, status):
+ for fun in (status, field):
fun.update(dt)
display.update(
[
status.sprites,
- field.get_sprites(),
+ field.sprites,
enemies.get_sprites(),
player.get_sprites()
])
diff --git a/src/sliceitoff/field/field.py b/src/sliceitoff/field/field.py
index c89ecdf..a6084f1 100644
--- a/src/sliceitoff/field/field.py
+++ b/src/sliceitoff/field/field.py
@@ -13,7 +13,6 @@ class FieldSprite(pygame.sprite.Sprite):
self.image.fill("green")
-
class Field():
def __init__(self):
self.sprites = pygame.sprite.Group()
@@ -67,11 +66,7 @@ class Field():
if y4 > y3:
self.sprites.add(FieldSprite( (ax, y3, aw, y4-y3) ))
return Scaling.area_to_rect((ax, y2, aw, y3-y2))
-
-
- def get_sprites(self) -> pygame.sprite.Group:
- return self.sprites
- def __del__(self):
+ def update(self, dt):
pass
\ No newline at end of file