Thanks Andrew, thats interesting. I’m a beginner with Corona and have a lot to learn!
My function looks like this. Is there any fundamental problems with this?
Thanks,
Mark
local function drawLevel()
– clear clouds from ‘prev screen’’
for i=#clouds, 0, -1 do
killObj(clouds[i])
end
numOfClouds = mRandom(4,9) – define how many clouds on screen
for i=0, numOfClouds do
local alphaRandom = mRandom(1, 3)
local flipXRandom = mRandom(10)
local stretchXRandom = mRandom(10)
local stretchXamtRandom = mRandom(2, 4)
local windspeed = mRandom(10000, 40000)
clouds[i] = display.newImage(“images/cloud3.png”)
if flipXRandom >6 then clouds[i].xScale = -1 end
if stretchXRandom >6 then clouds[i].xScale = stretchXamtRandom end
clouds[i].alpha = “0.” … alphaRandom
clouds[i].x= screenLeft+mRandom(screenWidth)
clouds[i].y= screenTop+mRandom(40,screenHeight)
transition.to( clouds[i], {delay=0, time=windspeed, x=screenLeft })
group:insert(clouds[i])
end