I am trying to make very smooth view movement, like in Super Meat Boy and such.
Currently, I am using this line of code to achieve this:
viewRect.Offset(((playerPos.x - lastPlayerPos) / viewSpeed) * timeDelta * 20.f,
((playerPos.y - lastPlayerPos) / viewSpeed) * timeDelta * 20.f);
If there is an fps lag spike however, the timeDelta variable will get bigger and the view will be shot forward with great speed. How could I improve this? :)