diff options
| author | Elizabeth Hunt <elizabeth@simponic.xyz> | 2024-08-20 17:34:18 -0700 |
|---|---|---|
| committer | Elizabeth Hunt <elizabeth@simponic.xyz> | 2024-08-20 17:34:18 -0700 |
| commit | b4140460014d1fc134df9127600f6da2346376e3 (patch) | |
| tree | 5bee11079f3ab9e3fd5d2a68cee483c2c33557f4 /kennel/engine/components/position.py | |
| parent | 6f223d2462df5e08856fb83fd76773a8af33acf9 (diff) | |
| download | kennel.hatecomputers.club-b4140460014d1fc134df9127600f6da2346376e3.tar.gz kennel.hatecomputers.club-b4140460014d1fc134df9127600f6da2346376e3.zip | |
init commit with base ECS and Network System
Diffstat (limited to 'kennel/engine/components/position.py')
| -rw-r--r-- | kennel/engine/components/position.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/kennel/engine/components/position.py b/kennel/engine/components/position.py new file mode 100644 index 0000000..2a4da4a --- /dev/null +++ b/kennel/engine/components/position.py @@ -0,0 +1,14 @@ +from .component import Component, ComponentType + + +class Position(Component): + def __init__(self, x: float, y: float): + super().__init__(ComponentType.POSITION) + self.x = x + self.y = y + + def __repr__(self) -> str: + return f"Position(x={self.x}, y={self.y})" + + def dict(self) -> dict: + return {"x": self.x, "y": self.y} |
