added alternate game mode "movingWalls"

This commit is contained in:
LuckyLaszlo
2022-12-02 21:01:06 +01:00
parent 93a40f2ad9
commit 59c7ae2a16
13 changed files with 136 additions and 24 deletions

View File

@@ -1,4 +1,6 @@
import { MovingRectangle } from "./class/Rectangle.js";
function random(min: number = 0, max: number = 1) {
return Math.random() * (max - min) + min;
}
@@ -16,4 +18,9 @@ function clamp(n: number, min: number, max: number) : number
return (n);
}
export {random, sleep, clamp}
function assertMovingRectangle(value: unknown): asserts value is MovingRectangle {
// if (value !== MovingRectangle) throw new Error("Not a MovingRectangle");
return;
}
export {random, sleep, clamp, assertMovingRectangle}