This is in C++ and I’m using VC++ 2010.
I am creating a tile-based game, each tile is 32 pixels. If you are given an amount of time, and in that time you want to move an image 32 pixels in a direction, how would I calculate the amount to move per each frame? The frame rate is not fixed and I have access to the frame delta time.
If you need more information just ask.
The basic formula you need to calculate it is:
P pixels / S seconds * delta T seconds/frame = X pixels/frame
For example we’ll use your tile size and move it in 1 second and the current frame rate is 30 fps.
32 pixels / 1 second * .033 seconds/frame = 1.056 pixels/frame