diff --git a/WebGames-master/WebGames-master/DevQuiz/index.html b/WebGames-master/WebGames-master/DevQuiz/index.html
index a91ce07e..0eb67155 100644
--- a/WebGames-master/WebGames-master/DevQuiz/index.html
+++ b/WebGames-master/WebGames-master/DevQuiz/index.html
@@ -141,26 +141,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games/HouseOfHazards-main/index.html b/WebGames-master/WebGames-master/games/HouseOfHazards-main/index.html
index 70ca648a..d8d9694c 100644
--- a/WebGames-master/WebGames-master/games/HouseOfHazards-main/index.html
+++ b/WebGames-master/WebGames-master/games/HouseOfHazards-main/index.html
@@ -49,26 +49,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/awesome-tanks-2/index.html b/WebGames-master/WebGames-master/games2/game/awesome-tanks-2/index.html
index 6679b807..93d67434 100644
--- a/WebGames-master/WebGames-master/games2/game/awesome-tanks-2/index.html
+++ b/WebGames-master/WebGames-master/games2/game/awesome-tanks-2/index.html
@@ -44,26 +44,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/backrooms/index.html b/WebGames-master/WebGames-master/games2/game/backrooms/index.html
index f9387544..64dec847 100644
--- a/WebGames-master/WebGames-master/games2/game/backrooms/index.html
+++ b/WebGames-master/WebGames-master/games2/game/backrooms/index.html
@@ -39,26 +39,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/bob-the-robber-2/index.html b/WebGames-master/WebGames-master/games2/game/bob-the-robber-2/index.html
index 5c430002..2ac3efdc 100644
--- a/WebGames-master/WebGames-master/games2/game/bob-the-robber-2/index.html
+++ b/WebGames-master/WebGames-master/games2/game/bob-the-robber-2/index.html
@@ -63,26 +63,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/cars-simulator/index.html b/WebGames-master/WebGames-master/games2/game/cars-simulator/index.html
index ddd90a66..5eff9e1c 100644
--- a/WebGames-master/WebGames-master/games2/game/cars-simulator/index.html
+++ b/WebGames-master/WebGames-master/games2/game/cars-simulator/index.html
@@ -52,26 +52,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/chess/index.html b/WebGames-master/WebGames-master/games2/game/chess/index.html
index 3dad6755..739eb193 100644
--- a/WebGames-master/WebGames-master/games2/game/chess/index.html
+++ b/WebGames-master/WebGames-master/games2/game/chess/index.html
@@ -197,26 +197,47 @@ alert("This is the numeric rappresentation of the chessboard:\n\n" + sRappr);
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/cluster-rush/index.html b/WebGames-master/WebGames-master/games2/game/cluster-rush/index.html
index 60137b83..e451eb23 100644
--- a/WebGames-master/WebGames-master/games2/game/cluster-rush/index.html
+++ b/WebGames-master/WebGames-master/games2/game/cluster-rush/index.html
@@ -99,26 +99,47 @@
}
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/cookie-clicker/index.html b/WebGames-master/WebGames-master/games2/game/cookie-clicker/index.html
index b2a3b885..11fd327d 100644
--- a/WebGames-master/WebGames-master/games2/game/cookie-clicker/index.html
+++ b/WebGames-master/WebGames-master/games2/game/cookie-clicker/index.html
@@ -238,26 +238,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/cubefield/index.html b/WebGames-master/WebGames-master/games2/game/cubefield/index.html
index 24c9da13..22db8a0a 100644
--- a/WebGames-master/WebGames-master/games2/game/cubefield/index.html
+++ b/WebGames-master/WebGames-master/games2/game/cubefield/index.html
@@ -53,26 +53,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/geometry-dash-remastered/index.html b/WebGames-master/WebGames-master/games2/game/geometry-dash-remastered/index.html
index 94e1c90d..24eaaf98 100644
--- a/WebGames-master/WebGames-master/games2/game/geometry-dash-remastered/index.html
+++ b/WebGames-master/WebGames-master/games2/game/geometry-dash-remastered/index.html
@@ -47,26 +47,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/idle-breakout/index.html b/WebGames-master/WebGames-master/games2/game/idle-breakout/index.html
index 1ad51e57..01307763 100644
--- a/WebGames-master/WebGames-master/games2/game/idle-breakout/index.html
+++ b/WebGames-master/WebGames-master/games2/game/idle-breakout/index.html
@@ -95,26 +95,131 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/just-fall/index.html b/WebGames-master/WebGames-master/games2/game/just-fall/index.html
index 622264f7..5387cafc 100644
--- a/WebGames-master/WebGames-master/games2/game/just-fall/index.html
+++ b/WebGames-master/WebGames-master/games2/game/just-fall/index.html
@@ -166,26 +166,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/retro-bowl/index.html b/WebGames-master/WebGames-master/games2/game/retro-bowl/index.html
index c8dbf4bd..fee1b4a9 100644
--- a/WebGames-master/WebGames-master/games2/game/retro-bowl/index.html
+++ b/WebGames-master/WebGames-master/games2/game/retro-bowl/index.html
@@ -132,26 +132,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/stick-merge/index.html b/WebGames-master/WebGames-master/games2/game/stick-merge/index.html
index 3ff56a75..7360b57f 100644
--- a/WebGames-master/WebGames-master/games2/game/stick-merge/index.html
+++ b/WebGames-master/WebGames-master/games2/game/stick-merge/index.html
@@ -80,26 +80,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/stickman-hook/index.html b/WebGames-master/WebGames-master/games2/game/stickman-hook/index.html
index 265c211d..96ae5b95 100644
--- a/WebGames-master/WebGames-master/games2/game/stickman-hook/index.html
+++ b/WebGames-master/WebGames-master/games2/game/stickman-hook/index.html
@@ -46,26 +46,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/subway-surfers/index.html b/WebGames-master/WebGames-master/games2/game/subway-surfers/index.html
index 44412f7f..4b6198cd 100644
--- a/WebGames-master/WebGames-master/games2/game/subway-surfers/index.html
+++ b/WebGames-master/WebGames-master/games2/game/subway-surfers/index.html
@@ -52,26 +52,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/tiny-fishing/index.html b/WebGames-master/WebGames-master/games2/game/tiny-fishing/index.html
index 08b6a2ac..64d8d10e 100644
--- a/WebGames-master/WebGames-master/games2/game/tiny-fishing/index.html
+++ b/WebGames-master/WebGames-master/games2/game/tiny-fishing/index.html
@@ -336,26 +336,68 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/vex3/index.html b/WebGames-master/WebGames-master/games2/game/vex3/index.html
index e3330f5c..6290e426 100644
--- a/WebGames-master/WebGames-master/games2/game/vex3/index.html
+++ b/WebGames-master/WebGames-master/games2/game/vex3/index.html
@@ -58,26 +58,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/vex4/index.html b/WebGames-master/WebGames-master/games2/game/vex4/index.html
index c9988fd1..d8f14455 100644
--- a/WebGames-master/WebGames-master/games2/game/vex4/index.html
+++ b/WebGames-master/WebGames-master/games2/game/vex4/index.html
@@ -80,26 +80,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/vex5/index.html b/WebGames-master/WebGames-master/games2/game/vex5/index.html
index fdcba8d9..da6007cb 100644
--- a/WebGames-master/WebGames-master/games2/game/vex5/index.html
+++ b/WebGames-master/WebGames-master/games2/game/vex5/index.html
@@ -62,26 +62,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/vex6/index.html b/WebGames-master/WebGames-master/games2/game/vex6/index.html
index 9a491279..cc4f4d91 100644
--- a/WebGames-master/WebGames-master/games2/game/vex6/index.html
+++ b/WebGames-master/WebGames-master/games2/game/vex6/index.html
@@ -65,26 +65,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/vex7/index.html b/WebGames-master/WebGames-master/games2/game/vex7/index.html
index 84027950..396b3012 100644
--- a/WebGames-master/WebGames-master/games2/game/vex7/index.html
+++ b/WebGames-master/WebGames-master/games2/game/vex7/index.html
@@ -71,26 +71,110 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/games2/game/worlds-hardest-game/index.html b/WebGames-master/WebGames-master/games2/game/worlds-hardest-game/index.html
index 088f089b..9c0c96b0 100644
--- a/WebGames-master/WebGames-master/games2/game/worlds-hardest-game/index.html
+++ b/WebGames-master/WebGames-master/games2/game/worlds-hardest-game/index.html
@@ -78,26 +78,89 @@
}
let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
+ let frames = 0;
+
+ function frameLoop() {
+ const now = performance.now();
+ frames++;
+
+ if (now - lastFrameTime >= 1000) {
+ const fps = Math.round(frames / ((now - lastFrameTime) / 1000));
+ fpsCounter.textContent = `FPS: ${fps}`;
+ frames = 0;
+ lastFrameTime = now;
+ }
+ requestAnimationFrame(frameLoop);
+ }
+ frameLoop();
+ }
+
+ calculateFPS(); // Start FPS calculation
+ } else {
+ fpsCounter.style.display = 'none'; // Hide FPS counter
+ }
\ No newline at end of file
diff --git a/WebGames-master/WebGames-master/index.html b/WebGames-master/WebGames-master/index.html
index bc5e82aa..a6d3aaa3 100644
--- a/WebGames-master/WebGames-master/index.html
+++ b/WebGames-master/WebGames-master/index.html
@@ -704,6 +704,7 @@
+