Replace FOV algorithm and add faux-3D

This commit is contained in:
2025-02-15 17:39:25 -08:00
parent e8c097fd74
commit b37ab048cd
7 changed files with 389 additions and 76 deletions

View File

@ -70,6 +70,17 @@ export class Point {
equals(other: Point): boolean {
return this.x == other.x && this.y == other.y;
}
scale(other: Point | Size) {
if (other instanceof Point) {
return new Point(this.x * other.x, this.y * other.y);
}
return new Point(this.x * other.w, this.y * other.h);
}
subtract(top: Point): Size {
return new Size(this.x - top.x, this.y - top.y);
}
}
export class Size {