How to make the game not frame rate dependent?

I'm making a game (also using Snapp to export it as .exe) and I want my game to not run differently if the player has a better frame rate (example, if the game is 120fps, it runs double the speed). I don't know if Snapp is different to Snap in this sense of frame rate dependant speed but if not, how would I fix this?

In addition, I use a transparent overlay in one of my games and randomly the frame rate will drop after a while. Switching between to a different transparent overlay and back fixes this temporarily.

One way is to use a wait secs block after each movement loop. This will ensure that it will always wait a certain amount of time before the next movement. A much better way is to use a game loop. At the end of the loop, it should wait until the frame is finished, then it will wait a very small time, then it'll repeat. That's probably the best way to get a fixed frame rate, and not have anything break.

I wouldn't want to use 'wait seconds' because if the frame rate is low it would cause more issues.
Where do I find a game loop?

A game loop is just a forever loop that has the main scripts for the project in it. You don't have to put all the scripts in it, in fact, it's cleaner if you put different parts of the scripts in block or just broadcast a message to the script.

The game I'm making this in has over 100 sprites and way more scripts than that, and most sprites have main scripts so completely changing the programming will be difficult, and also I don't 100% understand what you mean.

If there was a way to limit frame rate for the whole game, that would be incredibly useful.

Well, in that case, I don't know what you could do.

It's definitely an annoying situation. This question came from my friend running the game on their laptop and it was running way faster than it should have (might have been his monitor on 144 hertz) but when I tried it on mine, it limited to 60fps and the game worked.

Well, that issue has actually come up before, in fact, here's the solution to your problem.

Alright. I thought one possible solution would be to frame limit the game in the computer's settings. I'll have to put a notice in the game at the start.

maybe you can track the time and make everything move based on that amount of time.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.