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 d4895764ae
commit e7d35a0b2f
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;