Spawn Things With Timer

I am new to corona and after going 98% with my game and having it fail is bad. I was sad but I looked at that game as something that was meant to be. So I started programming using something else but I came back to corona after not going even 10% on the game.
I chose to make a new one. It is something that is pretty cool. I am not sure what it is called but the thing I need help with is, I want to spawn enemies based on time.
So like every 7 seconds I want 2 enemies to appear, well how would I do that?
[import]uid: 55737 topic_id: 9758 reply_id: 309758[/import]

timer.performWithDelay(7000,spawnEnemies,0) --funs spawnEnemies() function every 7 seconds

timer.performWithDelay(7000,function()
spawnEnemy(enemy1,{x=500,y=200})
spawnEnemy(enemy2,{x=100,y=200})
end,0)

–calls spawnEnemy with params (a table, ‘enemy1’ and a table of vars) using anonymous function wrapper

Any questions, just ask :smiley: [import]uid: 34945 topic_id: 9758 reply_id: 35566[/import]

And how did your previous game fail? [import]uid: 34945 topic_id: 9758 reply_id: 35567[/import]

oh I couldn’t get everything to work and funding was down so we couldn’t change all the graphics and the project was dropped [import]uid: 55737 topic_id: 9758 reply_id: 35569[/import]

no clue what you just said. I am at no code so far. I am trying to get my head around the main part of the game so I can build everything. It might be done in one night but I just can’t get my head around this code. I want to have a enemy in a spawn function and everything but I don’t know how to make it static to the moving background [import]uid: 55737 topic_id: 9758 reply_id: 35571[/import]

What kind of game is this, side scroller?
[import]uid: 34945 topic_id: 9758 reply_id: 35576[/import]

like it kinda like a doodle jump game but instead of platforms you are in a static position and have to shoot things and move things based on accelemoter [import]uid: 55737 topic_id: 9758 reply_id: 35587[/import]

make the background in a display.newGroup()
spawn the monster and add it to the displaygroup :slight_smile:

background = display.newGroup
backgroundImage = display.newImage(“bg.png”,0,0)
monster = display.newImage(“monster.png”,0,0)

background:insert(backgroundImage)
background:insert(monster)

–move around background, with monster
transition.to(background,{time=1000,x=100,y=100},1) [import]uid: 34945 topic_id: 9758 reply_id: 35589[/import]