From 6b3eda2ad197d2bd9d434f820f682f13e71c8fbb Mon Sep 17 00:00:00 2001 From: yuzu-eva Date: Fri, 20 Sep 2024 17:21:09 +0200 Subject: render shapes and add rotation --- circleshape.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 circleshape.py (limited to 'circleshape.py') diff --git a/circleshape.py b/circleshape.py new file mode 100644 index 0000000..eb08882 --- /dev/null +++ b/circleshape.py @@ -0,0 +1,22 @@ +import pygame + +# Base class for game objects +class CircleShape(pygame.sprite.Sprite): + def __init__(self, x, y, radius): + # we will be using this later + if hasattr(self, "containers"): + super().__init__(self.containers) + else: + super().__init__() + + self.position = pygame.Vector2(x, y) + self.velocity = pygame.Vector2(0, 0) + self.radius = radius + + def draw(self, screen): + # sub-classes must override + pass + + def update(self, dt): + # sub-classes must override + pass -- cgit v1.2.3