Hello I am new to corona sdk and I am learning through hit and trial in the sample code. One of the sample provided by corona is Jungle Scene, where the pics are moving and a cat chasing after a green dude…
I happen to pass through these codes and I would be grateful if you would explain me these codes…
if (grass.x + grass.contentWidth) < 0 then
grass:translate( 480 * 2, 0)
end
if (grass2.x + grass2.contentWidth) < 0 then
grass2:translate( 480 * 2, 0)
My first question is what is the function of object.contentWidth does. Please do explain and dnt give the definition already given in the corona website.
What does grass:translate(480*2,0) mean and why multiple by 2 and not other digit
Does grass.x give the x coordinate of the grass object(middle of the image as coordinate point)