I'm creating a 2D game with C ++ and SDL , where in time management I use the Delta-Time technique / em> (delta time) for movements with smooth movements. The execution is perfect, however there are displacements of objects (platforms) that depend on time, that is, to move, for example, 500px must do it in 6 seconds, all right up to this point.
Note: The movement is perpetual, that is, repeats infinitely
The problem occurs when there are more objects, since if there are two or more objects with the same duration and different speeds, a delay lag is observed between the objects, since they should reach their destination in the same time . It is understandable because Delta-Time does not have the same delay between each frame and generates displacement by various pixels.
Is there any way to control the lag, or is there another method for this type of movement that depends on a specific time?