I believe I did answer all your questions. Maybe more than once
Thanks for your patience
But it seems that we have misunderstanding caused by my fuzzy explanations...
So once again: if you want constant movement speed independent on framerate, you need to take the time delta into account, not just change the position everytime the script is updated.
Something like this (not an actual code, just to give you the idea):
Thanks for the idea, I understand time delta approach very well
but as I said in previous post -
"without large coordinates increments because sprite will lose moves smoothness"This way if the framerate is high, the object will move in multiple smaller steps. If the framerate is low, it will jump in bigger steps. But the overall movement speed will be more or less constant.
steps must be stable. in other words it means that I will not be able to calculate correct collision because moving steps will scaled.
In general when I switch off vsync i have 400 FPS and keyboard call executing
very fast (performance of my PC is stable of course
)
when I switch on vsync i have 60 FPS and keyboard call executing
much slower I think my computer doesn't works slower when FPS on my video card is changing
That's why I understand how to write code for case when PC performance is very low (but my game is not addressed for such old PCs).
But what should I do when computer is poweful and lower FPS limit is 60 and may be much higher.
Logically follows when I changed FPS from 400 to 60, WME proportionally increasing time delay between keyboard's calls in main cycle - I've checked it.
That is the question - how to manupulate 1000/FPS (like you said) time delay? When FPS is not limited (vsync=off) time delays are minimal (near 2,5 msec) between keyboard call and my sprite moves are perfect
When FPS is limited (vsync=on) time delays are large (near 17 msec) between keyboard call and my sprite moves are very slow.
(attention! - moving steps +5 identical in both cases)
My code doesn't contains complicated structures which can utilize that time intervals.
In case when vsync=on, my computer
forced to stand idle between keyboard calls? What's the reason?