From d35ab6cc851d3fc85f55cfb5676f8dc3552fab24 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 2 Sep 2024 20:10:35 -0700 Subject: a bit more progress --- static/src/vector.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'static/src/vector.ts') diff --git a/static/src/vector.ts b/static/src/vector.ts index e7be9fa..96bd721 100644 --- a/static/src/vector.ts +++ b/static/src/vector.ts @@ -7,4 +7,8 @@ export class Vec2 { public distance_to(that: Vec2): number { return Math.sqrt((this.x - that.x) ** 2 + (this.y - that.y) ** 2); } + + public copy(): Vec2 { + return new Vec2(this.x, this.y); + } } -- cgit v1.3