To fast!!!

Blitz3D Forums/Blitz3D Beginners Area/To fast!!!

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Long story short, you figure out how much time has passed since last frame, and that value (the titular delta time) is multiplied with, well, pretty much everything in your code. This way everything happening in your code scales to the framerate.

So for example, if an object is moving 1 unit per millisecond (very fast) and 15 milliseconds have elapsed since last frame, then you should increment the object's position by 15 units.

The main gotcha, and it's not very complicated once you know to do this, is that you want to average out the deltas so that you don't get jittering due to occasional minor lags and spikes in the framerate.