General improvements

I forgot what I actually changed. It may not even be playable, I just want to get this up there.
This commit is contained in:
Asraelite 2023-03-31 11:43:56 +02:00
parent 8a0bf0ada9
commit c73130e3ff
25 changed files with 584 additions and 274 deletions

View file

@ -57,16 +57,9 @@ function loop(fn, fps = 60) {
let interval = 1000 / fps;
(function loop(time) {
fn();
requestAnimationFrame(loop);
// again, Date.now() if it's available
let now = Date.now();
let delta = now - then;
if (delta > interval) {
then = now - (delta % interval);
fn();
}
})(0);
};