Hi guys,
I’m trying to make two images scroll horizontally over and over again. I’m using this piece of code:
bg[1] = display.newImage("img/bg/bg1.png") bg[1].x = centerX bg[1].y = actualH \* 1.05 bg[1].anchorY = 1 bg[1].yScale = 0.3 bg[1].xScale = 0.3 sceneGroup:insert(bg[1]) bg[2] = display.newImage("img/bg/bg1.png") bg[2].x = actualW \* 1.69 bg[2].y = actualH \* 1.05 bg[2].anchorY = 1 bg[2].yScale = 0.3 bg[2].xScale = 0.3 sceneGroup:insert(bg[2]) local speed = 0.3 function move() bg[1].x = bg[1].x-speed bg[2].x = bg[2].x-speed if(bg[1].x + bg[1].width/2 \< 0)then bg[1].x = bg[1].width\*3/2-speed elseif(bg[2].x + bg[2].width/2 \< 0)then bg[2].x = bg[2].width\*3/2-speed end end Runtime:addEventListener( "enterFrame", move )
The code works for the first run, but does not repeat. Could I get some help? 
Kind regards
Bram
)