summaryrefslogtreecommitdiff
path: root/Vec.py
diff options
context:
space:
mode:
Diffstat (limited to 'Vec.py')
-rw-r--r--Vec.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Vec.py b/Vec.py
index 9f22dd0..31a67da 100644
--- a/Vec.py
+++ b/Vec.py
@@ -1,9 +1,6 @@
class Vec2:
- x = 0
- y = 0
-
def __init__(self, x, y):
self.x = x
self.y = y
@@ -17,6 +14,9 @@ class Vec2:
def neg(self):
return Vec2(-self.x, -self.y)
+ def toString(self):
+ return f"({self.x}, {self.y})"
+
right = Vec2(1, 0)
up = Vec2(0, -1)
left = Vec2(-1, 0)