In my game, I’m spawning 18 objects via “timer.performWithDelay” It’s a side scrolling game where you must collide with 15 objects that vary +/- points, and 3 objects as power-ups.
I tried my best making the spawns unclustered but there’s many times where 3-4 objects will spawn at the same time making it clustered and dull gameplay. I’ve looked at just about every forum, table tutorial, and sample code there was and tried making tables many times and ended up confusing myself. I also tried using “enterFrame” but that spawned “object1” about 100 times at the same time. What I’m trying to do is create a table for objects1-15 and have them spawn one at a time. I’ve been stuck on this for a long time, can anyone please help me out?
Timers1- 18 are like this from object1 spawning every 0350 to object18 spawning every 91175 milliseconds
[code]
function object1Spawn()
object1 = display.newImage(“object1.png”)
object1.x = 510
object1.y = math.random(0,280)
localGroup:insert(object1)
transition.to (object1, {time=1500, x=-50})
physics.addBody(object1, {bounce=0.6})
object1.angularVelocity = math.random(-200,200)
object1.myName = “object1”
object1.collision = onobject1Collision
object1:addEventListener(“collision”, object1)
end
timer1 = timer.performWithDelay(0350, object1Spawn, 0 )
[import]uid: 114389 topic_id: 28533 reply_id: 328533[/import]