diff options
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 } } |