1
0
Fork 0
mirror of https://codeberg.org/ashley/poke.git synced 2024-11-17 05:34:40 -05:00

make 30 fps

This commit is contained in:
Ashley //// 2024-02-26 20:41:46 +00:00
parent 645c979c18
commit 7147eeb122

View file

@ -1898,7 +1898,7 @@ let lastDrawTime = 0; // Timestamp of the last draw request
const loop = () => { const loop = () => {
const now = performance.now(); const now = performance.now();
const elapsed = now - lastDrawTime; const elapsed = now - lastDrawTime;
if (elapsed >= (1000 / 24)) { if (elapsed >= (1000 / 30)) {
lastDrawTime = now; lastDrawTime = now;
ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height); ctx.drawImage(AMvideo, 0, 0, canvas.width, canvas.height);
} }