diff options
author | nil <niljo@airmail.cc> | 2024-12-13 20:00:50 +0100 |
---|---|---|
committer | nil <niljo@airmail.cc> | 2024-12-13 20:00:50 +0100 |
commit | 1b6275b4fbc4ab7bcd876938f807aad9ce1900a6 (patch) | |
tree | cd1c577a726f67afc2c276eb81ae1628edcdcd96 /src/engine/vector2.js | |
parent | 99c5056ffc4adec03f29730869158e5f80bc4304 (diff) |
add liberties
Diffstat (limited to 'src/engine/vector2.js')
-rw-r--r-- | src/engine/vector2.js | 19 |
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 } } |