Problem spawning object associated to its spawner

I have a set of tutorials explaining this exact process:

http://www.panc.co/tutorials.html

/shameless self-promotion

There is no end to the tutorials that exist for Corona SDK/Box2D collision management. Google will yield a cornucopia of info for you.

Thank you for your tutorials, dude. I’ve learned a lot by reading them. Nononetheless, how can I use the references you use for uncountable enemies as well as in the function I created? I want the enemies to be created indefinitely using a timer.

Do you get it?

I have to be honest, I’m having trouble following your logic without code examples. However, I will try to interpret your issue without examples.

I think you want to create unlimited enemies and have them move through your defined logic, while still being able to reference the enemies outside of the spawning function. If this is the case, using a “for” loop is probably going to be your best bet. If you take a look at my tutorial at panc.co you’ll see how you can spawn objects and assign identifiers to them. You can create a large amount of enemies off-screen and just run your transitions based on their identifiers.