I just met with a sample of corona sdk named as Many Crates…though the code is in difficult way so i changed it to easy sone that i can understand but with everything understood there is one thing left which is cannot understand and that is
local function newCrate( event ) local random = math.random( 100 ) if (random \<= 60) then crate = display.newImage("crate.png"); crate.x = 60 + math.random( 160 ) crate.y = -100 physics.addBody( crate, { density=0.9, friction=0.3, bounce=0.3} ) elseif (random \< 80) then crateB = display.newImage("crateB.png"); crateB.x = 60 + math.random( 160 ) crateB.y = -100 physics.addBody( crateB, { density=1.4, friction=0.3, bounce=0.2} ) else crateC = display.newImage("crateC.png"); crateC.x = 60 + math.random( 160 ) crateC.y = -100 physics.addBody( crateC, { density=0.3, friction=0.2, bounce=0.5} ) end end local dropCrates = timer.performWithDelay( 500, newCrate, 1000 )
local random =math.random(100)
so what is it…is it like saying to corona that screen height is 100 and when there is value less or equal to 60 then u will launch one crate(small one) or what its really confusing and sorry corona for the last time but please answer for the real question this time and dont say to self search as i am done with a lot and is unable to find anything…