summaryrefslogtreecommitdiff
path: root/src/engine/vector2.js
diff options
context:
space:
mode:
authornil <niljo@airmail.cc>2024-12-13 20:00:50 +0100
committernil <niljo@airmail.cc>2024-12-13 20:00:50 +0100
commit1b6275b4fbc4ab7bcd876938f807aad9ce1900a6 (patch)
treecd1c577a726f67afc2c276eb81ae1628edcdcd96 /src/engine/vector2.js
parent99c5056ffc4adec03f29730869158e5f80bc4304 (diff)
add liberties
Diffstat (limited to 'src/engine/vector2.js')
-rw-r--r--src/engine/vector2.js19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/engine/vector2.js b/src/engine/vector2.js
index 6c2a2a2..8b10e28 100644
--- a/src/engine/vector2.js
+++ b/src/engine/vector2.js
@@ -5,9 +5,20 @@ export class Vector2 {
}
static sum(a, b) {
- return new Vector2(
- a.x + b.x,
- a.y + b.y,
- )
+ return new Vector2(
+ a.x + b.x,
+ a.y + b.y,
+ )
+ }
+
+ static equals(a, b) {
+ if (
+ a.x == b.x &&
+ a.y == b.y
+ ) {
+ return true
+ }
+
+ return false
}
}