survivors: adding spread weapon

This commit is contained in:
Sheldan
2025-09-04 20:56:36 +02:00
parent c01ac53312
commit f2e62a7e74
3 changed files with 60 additions and 2 deletions

View File

@@ -62,6 +62,14 @@ export class Vector {
return Math.acos(this.dotProduct2(vector) / (this.vecLength() * vector.vecLength()))
}
rotate(angle: number) {
let c = Math.cos(angle);
let s = Math.sin(angle)
let x = this._x * c - this._y * s
let y = this._x * s + this._y * c
return new Vector(x, y)
}
get x(): number {
return this._x;
}