Original Post
Ok, here''s my problem:
I''ve seen all these articles on frame rate independent movement that take a velocity and adjust it based on the frame rate. For example, if my target speed is 50fps and the target velocity is 2, then on a machine that is running at 100fps the velocity would be 1 and on a machine that is running at 25fps the velocity would be 4. Get it? OK, thats all perfect for constant velocities, but what about velocities that aren''t constant. For example, let''s say that I have a mario-style side-scroller and when my guy jumps, his vertical velocity starts at -4 and I increment that every frame so that it goes -4, -3, -2, -1, 0, 1, 2, 3, 4 and then he''s back on the ground again. But if the frame rate drops to half the target speed then the velocities look like this: -8, -6, -4, -2, 0, 2, 4, 6, 8. and if the frame rate is double the target speed then the velocity of the guy looks like this: -2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2. See my problem? Any time that the velocity is not constant, things will get messed up. I will appreciate any help on this. Thanks!