Looping animation

I’m trying to get some cloud images to scroll across the screen and reset when they go off-screen, starting the whole animation again. I have four cloud images that I want to float gently across.
Any help? [import]uid: 92074 topic_id: 16523 reply_id: 316523[/import]

@stephen,

check for the cloud if it has gone off the screen by using

where N is the cloud number that you want to check for

cloudN:setReferencePoint(display.TopRightReferencePoint)  
local xPoint = cloudN.x  
if x\<=0 then  
 cloudN:setReferencePoint(display.TopLeftReferencePoint)  
 cloudN.x = \_W  
end  

where _W is the display.contentWidth

I am using the reference point to check rather than use redundant math and add width and so on.

cheers,

?:slight_smile: [import]uid: 3826 topic_id: 16523 reply_id: 61744[/import]