summaryrefslogtreecommitdiff
path: root/src/engine/vector2.js
diff options
context:
space:
mode:
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,
+ )
+ }
+}