+ 3
How to change the speed of the game loop ?
hy there. i make a coding course for the FAB and one thingg is coding the UI. my problem is that the range slider of the motor rpm (line 37) has to change with the code (line 93) the speed of the loop (line 151) during running the loop. So the idea. But the code doesnt work as it should. can someone help me pls ? https://sololearn.com/compiler-playground/WbZHdG83mFVe/?ref=app
2 Respuestas
+ 3
This example will help you:
https://sololearn.com/compiler-playground/W3yqIGx4PPZl/?ref=app
+ 1
You would need to clear the inteval and set a new one.
https://stackoverflow.com/questions/10576106/setintervalfunction-time-change-time-on-runtime#10576119
Maube requestAnimationFrame would be more suitable to what you try to do.