This commit is contained in:
2025-07-11 19:34:07 +02:00
parent eee3fe09cc
commit 0eb198f284
2 changed files with 11 additions and 3 deletions

10
main.py
View File

@@ -20,6 +20,11 @@ def main():
time = pygame.time.Clock()
dt = 0
updatable = pygame.sprite.Group()
drawable = pygame.sprite.Group()
Player.containers = (updatable, drawable)
player = Player(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)
while True:
@@ -29,9 +34,10 @@ def main():
pygame.Surface.fill(screen, (0,0,0))
player.update(dt)
updatable.update(dt)
player.draw(screen)
for drawing in drawable:
drawing.draw(screen)
pygame.display.flip() #refresh screen

View File

@@ -4,6 +4,8 @@ from constants import PLAYER_RADIUS, PLAYER_SPEED, PLAYER_TURN_SPEED
class Player(CircleShape):
#containers = []
def __init__(self, x, y):
super().__init__(x, y, PLAYER_RADIUS)
self.rotation = 0