My game uses accelerometer to move the main actor (a rocket) however despite getting close to 60 fps the movement is very jumpy. I put this down to not having a transition but this doesn’t seem to have sorted it:
I have tried:
[lua] local yGravity = event.xGravity
transition.to(rocket, {time=17, y = rocket.y - ((yGravity * 2) * 5) })
if rocket.y < 20 then
rocket.y = 20
elseif rocket.y > (_H - 20) then
rocket.y = _H - 20
end [/lua]
where 17 is approximately transitioned on the fps calculation for debugging and the other I have tried is
[lua]local yGravity = remote.xGravity
rocket.y = rocket.y - ((yGravity * 2) * 2)
print(rocket.y)
if rocket.y < 20 then
rocket.y = 20
elseif rocket.y > (_H - 20) then
rocket.y = _H - 20
end [/lua]
How do I get a smooth transition? Move it to a timer based calculation but my concern on this is making it responsive as the game gets pretty quick [import]uid: 103970 topic_id: 19712 reply_id: 319712[/import]