Comment on Pinball implemented using Squint, a ClojureScript dialectComments−thegeekpirate2yIt runs far too quickly on Firefox for whatever reason.−jakopo872yProbaly not a browser issue, looking at this line of the generated JS:var physics_scene = squint_core.atom(({ "gravity": [0, 0], "dt": (1 / 60), "balls": [], "obstacles": [], "flippers": [], "score": 0 }));I think it run faster for any refresh rate higher than 60hz.Changing the value from 60.0 to 120.0 in this line::dt (/ 1.0 60.0) ;; slow down simand recompiling, makes it run correctly.−BorkdudeOP2yIs there a way to get the refresh rate programmatically?−eplawless2yYeah, you drive things with https://developer.mozilla.org/en-US/docs/Web/API/window/requ... since it's dynamic−jakopo872yI was not able to find one, but this js snippet:https://gist.github.com/capfsb/3fd1b700b4732debb29aefd576cf5...correctly reports 240hz for me.The fun thing is that 240 makes everything too slow, whereas 120 works fine.
Comments
It runs far too quickly on Firefox for whatever reason.
Probaly not a browser issue, looking at this line of the generated JS:
I think it run faster for any refresh rate higher than 60hz.
Changing the value from 60.0 to 120.0 in this line:
and recompiling, makes it run correctly.
Is there a way to get the refresh rate programmatically?
Yeah, you drive things with https://developer.mozilla.org/en-US/docs/Web/API/window/requ... since it's dynamic
I was not able to find one, but this js snippet:
correctly reports 240hz for me.
The fun thing is that 240 makes everything too slow, whereas 120 works fine.