Hi guys, I’m new to Corona/Programming, and was hoping I could get a little help from the senior programmers if you will.
I have 2 objects falling from the top, my countown functions as soon as they spawn and changes to Go and Win/Fail etc.
Each time I try to change the total amount of objects to spawn, it won’t register and spawns the same number for each.
For example;
O1 = 0
O2 = 0
time\_remain = 10
time\_up = false
total\_object1 = 4
total\_object2 = 2
ready = true
That is the top of the page, my timer is linked to Object1, is it supposed to be linked to both?
[code]
local function spawnObject()
local object1= display.newImageRect(“XX.png”, 40, 40)
object1:setReferencePoint(display.CenterReferencePoint)
object1.x = 35; object1.y = 80
–increment O1 for every object1 created
O1 = O1+1
object1:addEventListener(“touch”, object1)
physics.addBody(object1, {density=0.3, friction=0.6, radius=20} )
tmr = timer.performWithDelay(20, spawnObject, total_object1)[/code]
If someone could help me with a table or code that could allow me to control the number of spawn, I’d be extremely grateful.
Thank you [import]uid: 41602 topic_id: 7811 reply_id: 307811[/import]