I am making game for android using libgdx my requirement is that when character play game normaly then we work as
if velocity == normal(==25)
cam.position.y = character.position.y;
But in case getting some power then need is that we smoothly increese y-position of character
for that I assign as
if when velocity >25(means get power)
cam.position.y = character.position.y-screenHieght/3;
it is working but character is not move smoothly move with jerk and no real effect is comming.
Please anyone help me how I can solve this problem?
After giving a second read to your question I think you are asking how to smoothly update your camera regardless of the speed the player is moving at.
Here’s how i update my camera :
cambounds is a huge rectangle which defines the camera’s movement limits, so you might omit that part if it’s not helpful for your case