Frame rate measurer deleted

This commit is contained in:
Mal
2024-04-04 21:48:01 +02:00
parent 8780d57df2
commit 3d4235766d
3 changed files with 4 additions and 107 deletions

View File

@@ -8,8 +8,6 @@ import UserInterface from "./ui/UserInterface.js";
import Key from "./Key.js";
import Setting from "./Setting.js";
import {EventBus} from "./events/EventBus.js";
import InterfaceEvent from "./events/InterfaceEvent.js";
import FrameRateMeasurer from "./FrameRateMeasurer.js";
export class Game
@@ -18,8 +16,8 @@ export class Game
constructor(level) {
this.level = level;
this.fps = 0;
this.frameDuration = 0;
this.fps = 60;
this.frameDuration = 1000.0 / this.fps;
this.lastRendered = undefined;
this.lastTimestamp = undefined;
this.canvas = document.getElementById('canvas');
@@ -216,17 +214,9 @@ export class Game
this.architecture.setMovableToStartPosition(this.mrCroc);
this.architecture.setMovableToTargetPosition(this.gisela);
EventBus.addEventListener(
InterfaceEvent.FRAME_RATE_MEASURED,
(event) => {
this.isPaused = false;
this.fps = event.frameRate;
this.frameDuration = 1000.0 / this.fps;
window.requestAnimationFrame(loopFunction);
}
);
this.isPaused = false;
new FrameRateMeasurer();
window.requestAnimationFrame(loopFunction);
}
isChromeBrowser()