Add a general rule framework with constants and UI that can add rules

This commit is contained in:
csd4ni3l
2025-11-22 14:43:11 +01:00
parent 94479f3eb2
commit 9106a5887b
6 changed files with 494 additions and 6 deletions

25
game/sprites.py Normal file
View File

@@ -0,0 +1,25 @@
import pyglet
from utils.constants import DEFAULT_X_VELOCITY, DEFAULT_Y_VELOCITY
class BaseShape():
def __init__(self):
self.x_velocity = DEFAULT_X_VELOCITY
self.y_velocity = DEFAULT_Y_VELOCITY
def update(self, gravity):
self.x += self.x_velocity
self.y += self.y_velocity
self.y -= gravity
class Circle(pyglet.shapes.Circle, BaseShape):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Rectangle(pyglet.shapes.Rectangle, BaseShape):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
class Triangle(pyglet.shapes.Triangle, BaseShape):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)