1
0
mirror of https://git.boykissers.com/pawkey/pawkey-sk.git synced 2025-12-20 04:04:16 +00:00

bubble-game: Use setInterval instead of requestAnimationFrame

This makes sure Misskey's Bubble Game always runs at a consistent rate, even when the monitor isn't 60hz
This commit is contained in:
CenTdemeern1
2024-10-28 17:52:08 +01:00
parent 4918ae34a5
commit f9100d4dcf
2 changed files with 18 additions and 17 deletions

View File

@@ -51,7 +51,7 @@ export class DropAndFusionGame extends EventEmitter<{
public readonly DROP_COOLTIME = 30; // frame
public readonly PLAYAREA_MARGIN = 25;
private STOCK_MAX = 4;
private TICK_DELTA = 1000 / 60; // 60fps
public readonly TICK_DELTA = 1000 / 60; // 60fps
public frame = 0;
public engine: Matter.Engine;