aboutsummaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorJoris2021-02-14 20:25:55 +0100
committerJoris2021-02-14 20:25:55 +0100
commitf47b2e3f68e69238b731d6183e739805db20ae5b (patch)
tree2eaa3937cdec3dccf4e751f9b519833740e69aca /src/model
parent0b60fd8c2cf5746a45cea137d2eac918ca7a8307 (diff)
Control a ship that can fire missiles
Diffstat (limited to 'src/model')
-rw-r--r--src/model/vec2.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/model/vec2.ts b/src/model/vec2.ts
new file mode 100644
index 0000000..4bec53d
--- /dev/null
+++ b/src/model/vec2.ts
@@ -0,0 +1,15 @@
+export interface Vec2 {
+ x: number,
+ y: number,
+}
+
+export function zero(): Vec2 {
+ return {
+ x: 0,
+ y: 0,
+ }
+}
+
+export function equals(v1: Vec2, v2: Vec2): boolean {
+ return v1.x === v2.x && v1.y === v2.y
+}