summaryrefslogtreecommitdiff
path: root/circleshape.py
diff options
context:
space:
mode:
authoryuzu-eva <stevenhu@web.de>2024-09-20 17:21:09 +0200
committeryuzu-eva <stevenhu@web.de>2024-09-20 17:21:09 +0200
commit6b3eda2ad197d2bd9d434f820f682f13e71c8fbb (patch)
tree87f7e5fc451c613082523f088ac4c8d604c9df75 /circleshape.py
parent9e795071dc9aca96e513bf37ac941b0fe4aeccba (diff)
render shapes and add rotation
Diffstat (limited to 'circleshape.py')
-rw-r--r--circleshape.py22
1 files changed, 22 insertions, 0 deletions
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