I am developing an upward scrolling game. I achieve this by reseting the y-values of certain objects on every frame redraw. I am having problems with image tearing(The images aren’t being redrawn in sync). I’m also not sure the screens being refreshed often enough. What am I doing wrong?
local function moveCamera()
if( background.y \< background.height - display.contentHeight ) then
local old = background.y
background.y = background.height - display.contentHeight - eek.y - eek.height
leftBranch.y = leftBranch.y + background.y-old
treeTopLeft.y = treeTopLeft.y + background.y-old
rightBranch.y = rightBranch.y + background.y-old
treeTopRight.y = treeTopRight.y + background.y-old
end
end
Runtime:addEventListener( "enterFrame", moveCamera )
Note: I have the FPS setting set to 30; changing it to 60 didn’t help. [import]uid: 60927 topic_id: 10736 reply_id: 310736[/import]