diff options
author | nil <niljo@airmail.cc> | 2024-12-13 16:42:57 +0100 |
---|---|---|
committer | nil <niljo@airmail.cc> | 2024-12-13 16:42:57 +0100 |
commit | cec1da14708e782801d0cc27fb13ff7586c0e96c (patch) | |
tree | ccd80c58e0aba22facb937c88ec5c9957055e4a1 /src/engine/vector2.js | |
parent | 16e02376e2273eeb25a6461f84641e96a485f652 (diff) |
liberty check demo
Diffstat (limited to 'src/engine/vector2.js')
-rw-r--r-- | src/engine/vector2.js | 13 |
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, + ) + } +} |