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:
parent
645c979c18
commit
7147eeb122
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue