I have an object that is automatically created using the following code:
cratesEaten = 0
crateCounter = 1
crateCount = 7
local function onFrame(event)
-- If Statement for the generation of the crates
-- from top of the screen to the bottom
crateCounter = crateCounter + 1
if(crateCounter % 40 == 0 and crateCount \> 0) then
crateCount = crateCount - 1
local crate1 = display.newImage("crate.png")
-- crate1.x = math.random(0, 310)
crate1.x = 30
crate1.y = -100
-- crate1.rotation = math.random(0, 360)
--physics.addBody(crate1, {density = 2.0, friction = 1.5, bounce=0.01})
physics.addBody(crate1, {density = 2.0, friction = 1.5, bounce=0.01})
crate1.myName = "crate"
end
end
Just need to know how to stop the delay of when the objects are created. Even when I have crate one spawn off screen there is a delay. [import]uid: 23642 topic_id: 36602 reply_id: 336602[/import]