I'm new to Game programmming and SDL, and I have been following Lazyfoo's SDL tutorials. My question is related to time based motion and frame rate based motion, basically which is better or appropriate depending on situations?. Could you give me an example where each of these methods are used?.
Another question I have is that, in lazyfoo's two Motion tutorials (FPS based and time based) The time based method showed a much smoother animation while the Frame rate based one was a little hiccupy, meaning you could clearly see the gap between the previous location of the dot and its current position when you compare the two programs.
As beginner which method should I stick to?(all I want is smooth animations).
Answer
What's being shown as "FPS based" there is . . . well, basically, it's awful. It's pinning the game's speed to the performance of one particular computer. If you upgrade to a nice fast computer, your game will suddenly run in turbo speed, if you downgrade to a slower computer you'll be grinding around in slo-mo.
The real choice is fixed time step vs. variable time step, and at that point I will defer to this excellent post which goes into great depth.
No comments:
Post a Comment