Hi guys,
I am making a scrolling game but I am facing some difficulties using transitions.
I need to make a parallax background but it looks jerky when I run it. I searched a lot
if someone had an answer for this but in vain.
The problem is that I can’t get the object transition smoothly. I am not sure if this is
caused from the build of Corona I am using or something else. I created a demo
project which you can try.
I doubt that Corona can’t transition objects smoothly?
Any help will be appreciated.
[lua]
– hide the status bar
display.setStatusBar( display.HiddenStatusBar )
local circle = display.newCircle(0,0, 50)
circle.x = display.contentWidth*1.2
circle.y = 200
– create the first transition
transition.to(circle, {time = 8000, x = -240, onComplete = function()
circle.x = display.contentWidth*1.2
end
})
– start looping the transitions
timer.performWithDelay(8100, function()
transition.to(circle, {time = 8000, x = -240, onComplete = function()
circle.x = display.contentWidth*1.2
end
})
end, -1 )
[/lua]