mirror of
https://github.com/csd4ni3l/chaos-protocol.git
synced 2026-01-01 04:23:43 +01:00
add a better rule system, and part of the functionality works now.
This commit is contained in:
@@ -4,6 +4,7 @@ from utils.constants import DEFAULT_X_VELOCITY, DEFAULT_Y_VELOCITY
|
||||
|
||||
class BaseShape():
|
||||
def __init__(self):
|
||||
self.shape_type = ""
|
||||
self.x_velocity = DEFAULT_X_VELOCITY
|
||||
self.y_velocity = DEFAULT_Y_VELOCITY
|
||||
|
||||
@@ -15,11 +16,29 @@ class BaseShape():
|
||||
class Circle(pyglet.shapes.Circle, BaseShape):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
BaseShape.__init__(self)
|
||||
self.shape_type = "circle"
|
||||
|
||||
@property
|
||||
def shape_size(self):
|
||||
return self.radius
|
||||
|
||||
class Rectangle(pyglet.shapes.Rectangle, BaseShape):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
BaseShape.__init__(self)
|
||||
self.shape_type = "rectangle"
|
||||
|
||||
@property
|
||||
def shape_size(self):
|
||||
return self.width
|
||||
|
||||
class Triangle(pyglet.shapes.Triangle, BaseShape):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
BaseShape.__init__(self)
|
||||
self.shape_type = "triangle"
|
||||
|
||||
@property
|
||||
def shape_size(self):
|
||||
return self.x2 - self.x
|
||||
Reference in New Issue
Block a user