19 lines
462 B
Python
19 lines
462 B
Python
from .component import Component
|
|
from ..servers.physics import PhysicsServer
|
|
|
|
|
|
class CollideRect(Component):
|
|
def __init__(self, rect, static=True, solid=True):
|
|
super().__init__()
|
|
self.rect = rect
|
|
self.static = static
|
|
self.solid = solid
|
|
self.vx = 0
|
|
self.vy = 0
|
|
|
|
def register(self):
|
|
PhysicsServer().register_component(self)
|
|
|
|
def unregister(self):
|
|
PhysicsServer().register_component(self)
|