Constant movement stutters

Hello all,

I am creating my first game (a flappy bird clone) in Corona but the constant movement is lagging a little on my HTC One. Just a small stutter every two seconds. First I thought this was a performance issue that I had to solve, but I have not been able to fix it yet.

So I did another test with very little code and very simple graphics but the movement is still lagging on my HTC One. See the attached zip file.

I hope someone has a fix for this problem.

Source code (see attached zip file):

local physics = require( "physics" ) physics.start() local screenW = display.contentWidth local screenCenterY = display.contentCenterY local speed = 4 local background = display.newImage( "bkg\_clouds.png", 360, 480 ) background.anchorX = 0 background.anchorY = 0 background.x = 0 background.y = 0 local crate1 = display.newImageRect("crate.png", 60, 60) crate1.y = screenCenterY + 100 local crate2 = display.newImageRect("crate.png", 60, 60) crate2.y = screenCenterY - 100 physics.addBody( crate1, "static", { density=3.0, friction=0.5, bounce=0.3 } ) physics.addBody( crate2, "static", { density=3.0, friction=0.5, bounce=0.3 } ) local function move() &nbsp;&nbsp; &nbsp;if crate1.x \< -100 then &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;crate1.x = screenW + 100 &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;crate2.x = screenW + 100 &nbsp;&nbsp; &nbsp;else &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;crate1.x = crate1.x - speed &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;crate2.x = crate2.x - speed &nbsp;&nbsp; &nbsp;end end Runtime:addEventListener( "enterFrame", move ) &nbsp;

Here’s a Flappy Bird template, which might help you out.

Thanks for your answer but I cannot find a fix for this specific issue in the source code. I think it has something to do with the frames per second which is not constant. I read a post about delta time and tried it but that didn’t solve the stutter.

The same question is asked before here:

http://forums.coronalabs.com/topic/44783-choppy-performance-when-moving-image-across-screen/

Almost all flappy bird clones have this lag / stutter btw.

Try the source code on a high end phone and you will see what I mean.

Here’s a Flappy Bird template, which might help you out.

Thanks for your answer but I cannot find a fix for this specific issue in the source code. I think it has something to do with the frames per second which is not constant. I read a post about delta time and tried it but that didn’t solve the stutter.

The same question is asked before here:

http://forums.coronalabs.com/topic/44783-choppy-performance-when-moving-image-across-screen/

Almost all flappy bird clones have this lag / stutter btw.

Try the source code on a high end phone and you will see what I mean.