diff --git a/game.py b/game.py index 4bb33f3..02bb781 100644 --- a/game.py +++ b/game.py @@ -1,14 +1,9 @@ from jorcademy import * -angle = 0 - def setup() -> None: - screen(800, 600) + pass def draw() -> None: - global angle - #text((128, 0, 128), 600, 300, 200, 100, angle) - ellipse((255, 255, 255), 400, 300, 1, 1) - angle += 1 + pass diff --git a/primitives.py b/primitives.py index 59dae35..55ae86e 100644 --- a/primitives.py +++ b/primitives.py @@ -80,10 +80,13 @@ def __init__(self, content, surface, color, x, y, w, h, rotation=0): self.surface = surface def draw(self, context: pygame.display): - # Set the position of the text - text_position = self.surface.get_rect() - text_position.center = (self.x, self.y) # Centered on the screen - context.blit(self.surface, text_position) + # Rotate surface + self.surface = pygame.transform.rotate(self.surface, self.rotation) + rect = self.surface.get_rect() + rect.center = (self.x, self.y) + + # Draw surface + context.blit(self.surface, rect) # Derived class - representing an image object