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() if crate1.x \< -100 then crate1.x = screenW + 100 crate2.x = screenW + 100 else crate1.x = crate1.x - speed crate2.x = crate2.x - speed end end Runtime:addEventListener( "enterFrame", move )