matter-js icon indicating copy to clipboard operation
matter-js copied to clipboard

Does this loop separate game logic from fps?

Open xeon826 opened this issue 3 years ago • 1 comments

Though I don't believe it's technically a loop, I'm wondering if this short snippet entails that the logic in my game is separated from the fps:

  Runner.run(Runner.create(), engine);
  Events.on(engine, "beforeUpdate", function (e) {
    // Update things
  });

I'd like for it to be the case that the logic in my game is independent from fps because I wouldn't want it to run differently based on the users hardware, if it's not the case, are there any options I should use maybe for the runner like delta: false?

xeon826 avatar Oct 17 '22 22:10 xeon826

Closing this thread to refer to updates in #702 on this topic, thanks again for the report here.

liabru avatar Nov 12 '23 19:11 liabru

As of 0.20.0 there is now built in Matter.Runner support by default for fixed timestep with high refresh displays see https://github.com/liabru/matter-js/pull/1300.

liabru avatar Jun 24 '24 20:06 liabru