From f47b2e3f68e69238b731d6183e739805db20ae5b Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 14 Feb 2021 20:25:55 +0100 Subject: Control a ship that can fire missiles --- src/model/vec2.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/model/vec2.ts (limited to 'src/model/vec2.ts') 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 +} -- cgit v1.2.3