mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Frame rate measurer deleted
This commit is contained in:
18
js/Game.js
18
js/Game.js
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user