From 8ed6d26c40ed35eed62688af309ff3454796ac7a Mon Sep 17 00:00:00 2001 From: BOTAlex Date: Sun, 31 Mar 2024 01:02:29 +0100 Subject: [PATCH] Better Zhen animation --- src/routes/zhen/+page.svelte | 108 +++++++++++++++++++------------ src/routes/zhen/Utils/Vector2.ts | 21 ++++++ 2 files changed, 88 insertions(+), 41 deletions(-) create mode 100644 src/routes/zhen/Utils/Vector2.ts diff --git a/src/routes/zhen/+page.svelte b/src/routes/zhen/+page.svelte index b5cf54b..e492cff 100644 --- a/src/routes/zhen/+page.svelte +++ b/src/routes/zhen/+page.svelte @@ -1,75 +1,101 @@ - +
+
-
- TEXT!!! + TEXT!!!
\ No newline at end of file + diff --git a/src/routes/zhen/Utils/Vector2.ts b/src/routes/zhen/Utils/Vector2.ts new file mode 100644 index 0000000..7fd53cb --- /dev/null +++ b/src/routes/zhen/Utils/Vector2.ts @@ -0,0 +1,21 @@ +export class Vector2 { + x: number; + y: number; + + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } + + Add(vec2: Vector2){ + return new Vector2(this.x + vec2.x, this.y + vec2.y); + } + + Sub(vec2: Vector2){ + return new Vector2(this.x - vec2.x, this.y - vec2.y); + } + + Scale(mult: number){ + return new Vector2(this.x * mult, this.y * mult);; + } +}