I am having a difficult time trying to figure out how increase the number of asteriods spawned overtime. I’m trying to decrease the spawnTime by 10 miliseconds every 10 seconds, then have the timer repeat 30 times before she finishes.
Thanks for your help 
local comet, comet2, comet3, bounds, imageTable, childGroup, spawnTimer, cometTimer
local physics = require( “physics” )
local minimumX = 50
local maximumX = display.viewableContentWidth - 50
local minimumY = 50
local maximumY = display.viewableContentHeight - 50
local P = {}
bounds = {
xMin = 0,
xMax = display.viewableContentWidth,
yMin = -300,
yMax = -100,
spawnTime = 800,
spawnOnTimer = 1,
spawnInitial = 0
}
imageTable = { “comet2.png”, “comet3.png” }
childGroup = display.newGroup()
function P.spawnItem()
a = math.random( 1, 2 )
comet = display.newImageRect( imageTable[a], 200, 200 )
comet.x = math.random( bounds.xMin, bounds.xMax )
comet.y = math.random( bounds.yMin, bounds.yMax )
physics.addBody( comet, { density=1.0, bounce=0.1, radius=85, filter=cometCollisionFilter } )
comet.angularVelocity = -200
comet.gravityScale = 0.8
comets[#comets + 1] = comet
childGroup:insert( comet )
comet = display.newImageRect( imageTable[a], 180, 180 )
comet.x = math.random( bounds.xMin, bounds.xMax )
comet.y = math.random( bounds.yMin, bounds.yMax )
physics.addBody( comet, { density=1.0, bounce=0.1, radius=75, filter=comet2CollisionFilter } )
comet.angularVelocity = 375
comet.gravityScale = 1.0
comets[#comets + 1] = comet
childGroup:insert( comet )
comet = display.newImageRect( imageTable[a], 150, 150 )
comet.x = math.random( bounds.xMin, bounds.xMax )
comet.y = math.random( bounds.yMin, bounds.yMax )
physics.addBody( comet, { density=1.0, bounce=0.1, radius=60, filter=comet3CollisionFilter } )
comet.angularVelocity = -250
comet.gravityScale = 0.9
comets[#comets + 1] = comet
childGroup:insert( comet )
sceneGroup:insert( childGroup )
return comet
end
function P.removeComet()
if ( table.maxn( comets ) >= 0 ) then
for i=1, table.maxn( comets ) do
if comets[i].y > maximumY + 200 then
comets[i]:removeSelf()
comets[i] = nil
table.remove( comets, i )
return
end
end
end
end
Runtime:addEventListener( “enterFrame”, P.removeComet )
function P.increaseComets()
bounds.spawnTime = bounds.spawnTime -10
end
spawnTimer = timer.performWithDelay( bounds.spawnTime, P.spawnItem, 0 )
cometTimer = timer.performWithDelay( 10000, P.increaseComets, 30 )