Up to now I’ve been animating values fairly laboriously, but the time has come for me to harness tween power. I thought I would start with a simple linear tween of an object moving onto screen, but the animation is all over the place. It’s clearly not a frame rate issue because the object jerks back and forth. A video probably illustrates it best.
Here’s a snippet of the code I’m using. The book object which is drawn by TheBook:DrawCard() is entirely static, and I’ve been animating it the laborious way with no issues. The offscreen starting vector “bookpos” is defined in setup and is not manipulated at all aside from this tween function. Has anyone else had (and preferably solved!) these issues?
function ShowCharacter:BookAnim()
pushMatrix()
translate(bookpos.x, bookpos.y)
TheBook:DrawCard()
tween(2, bookpos, {x = 300}, tween.easing.linear)
popMatrix()
end