3

The time I implemented a variable timer in my game on NodeJS. I noticed it would not always run at 60 fps depending on the machine. I implemented a check to see if the fps is above or below 60. If the fps was above I added more time between each run, if it was lower I shortened the time(to a limit). Sure it is a bit hacky but it worked well. As an added bonus the check runs every loop so even if another program is started and slows down the machine, the game can speed back up to 60 fps.

Comments
Add Comment