Jerky / choppy / non-smooth image movement

I also saw that your FPS is at 30. Change it to 60 and try this code for starters:

local smiley = display.newImage("testimg.png") local speed = 2 local moveSmiley = function(event) smiley.x = smiley.x - speed if smiley.x \< 0 then smiley.x = 300 end end -- moveSmiley Runtime:addEventListener("enterFrame", moveSmiley)

@thomas:- can you please upload here modified code.

Thanks in advance. 

Alya: have you tried my sample code first, and if so, how does this run?

Cheers,

Thomas

Christian: same question to you: did you try my simple code? I’m trying to help you out, but first we need to establish where the problem arises.

Even I am facing same problem.

Anybody got solution?

Wow. Does it run like this on the device as well? My project is, uhm, infinitely more complex and it runs supersmooth, even on an iPhone 3, so I’m sure there is a problem somewhere.

I’ll try checking your code, but I don’t have the time to delve in deeply, so no promises here.

Hi! Just checked your code. No major issues here, but I do see some red flags.

You are calling display.fps on every frame. Don’t! Just set this to 30 or 60, whichever you are using, but don’t make a system call every frame that is unnecessary.

local deltaTime = temp-runtime

imgObj.x = imgObj.x -deltaTime*speed

Should suffice. Try this and let me know how this goes.

I also saw that your FPS is at 30. Change it to 60 and try this code for starters:

local smiley = display.newImage("testimg.png") local speed = 2 local moveSmiley = function(event) smiley.x = smiley.x - speed if smiley.x \< 0 then smiley.x = 300 end end -- moveSmiley Runtime:addEventListener("enterFrame", moveSmiley)

@thomas:- can you please upload here modified code.

Thanks in advance. 

Alya: have you tried my sample code first, and if so, how does this run?

Cheers,

Thomas

Christian: same question to you: did you try my simple code? I’m trying to help you out, but first we need to establish where the problem arises.