summaryrefslogtreecommitdiff
path: root/src/engine/vector2.js
diff options
context:
space:
mode:
authornil <niljo@airmail.cc>2024-12-13 16:42:57 +0100
committernil <niljo@airmail.cc>2024-12-13 16:42:57 +0100
commitcec1da14708e782801d0cc27fb13ff7586c0e96c (patch)
treeccd80c58e0aba22facb937c88ec5c9957055e4a1 /src/engine/vector2.js
parent16e02376e2273eeb25a6461f84641e96a485f652 (diff)
liberty check demo
Diffstat (limited to 'src/engine/vector2.js')
-rw-r--r--src/engine/vector2.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/engine/vector2.js b/src/engine/vector2.js
new file mode 100644
index 0000000..6c2a2a2
--- /dev/null
+++ b/src/engine/vector2.js
@@ -0,0 +1,13 @@
+export class Vector2 {
+ constructor(x, y) {
+ this.x = x
+ this.y = y
+ }
+
+ static sum(a, b) {
+ return new Vector2(
+ a.x + b.x,
+ a.y + b.y,
+ )
+ }
+}