Quick Questions: Object Spawning and External Modules

Say I’m in my level1.lua, and I need to spawn an object; but, I have all of my “spawining” functions in another module called “spawning.lua.”
When I call that function from level1.lua, where does the resulting spawned object “reside” for the purposes of removal later on?

Any concerns I should have about references? [import]uid: 73951 topic_id: 36126 reply_id: 336126[/import]

Any ideas? This is really important to the structure of my game. [import]uid: 73951 topic_id: 36126 reply_id: 143524[/import]

Hi @mort,
You might find the technique I outline in the following post to be useful. It basically lets you pass a display group as an argument to a function of another module, so you then know that objects created in that other module reside in a specific display group, and you can clean them up later from that group.

https://developer.coronalabs.com/forum/2013/02/12/removing-display-objects-memory-without-inserting-selfview

Best regards,
Brent [import]uid: 200026 topic_id: 36126 reply_id: 143548[/import]

@Brent Thanks a bunch, as always, for your prompt and concise responses. I may have to give you a “special thanks” credit in my game when it’s done! [import]uid: 73951 topic_id: 36126 reply_id: 143660[/import]

Hi @mort,
You’re welcome, always happy to help. Credit in your game would be more than I deserve, but definitely let me know when your game is finished and in the market, because I want to check it out and see what you’ve accomplished!

Brent [import]uid: 200026 topic_id: 36126 reply_id: 143770[/import]

Any ideas? This is really important to the structure of my game. [import]uid: 73951 topic_id: 36126 reply_id: 143524[/import]

Hi @mort,
You might find the technique I outline in the following post to be useful. It basically lets you pass a display group as an argument to a function of another module, so you then know that objects created in that other module reside in a specific display group, and you can clean them up later from that group.

https://developer.coronalabs.com/forum/2013/02/12/removing-display-objects-memory-without-inserting-selfview

Best regards,
Brent [import]uid: 200026 topic_id: 36126 reply_id: 143548[/import]

@Brent Thanks a bunch, as always, for your prompt and concise responses. I may have to give you a “special thanks” credit in my game when it’s done! [import]uid: 73951 topic_id: 36126 reply_id: 143660[/import]

Hi @mort,
You’re welcome, always happy to help. Credit in your game would be more than I deserve, but definitely let me know when your game is finished and in the market, because I want to check it out and see what you’ve accomplished!

Brent [import]uid: 200026 topic_id: 36126 reply_id: 143770[/import]

Any ideas? This is really important to the structure of my game. [import]uid: 73951 topic_id: 36126 reply_id: 143524[/import]

Hi @mort,
You might find the technique I outline in the following post to be useful. It basically lets you pass a display group as an argument to a function of another module, so you then know that objects created in that other module reside in a specific display group, and you can clean them up later from that group.

https://developer.coronalabs.com/forum/2013/02/12/removing-display-objects-memory-without-inserting-selfview

Best regards,
Brent [import]uid: 200026 topic_id: 36126 reply_id: 143548[/import]

@Brent Thanks a bunch, as always, for your prompt and concise responses. I may have to give you a “special thanks” credit in my game when it’s done! [import]uid: 73951 topic_id: 36126 reply_id: 143660[/import]

Hi @mort,
You’re welcome, always happy to help. Credit in your game would be more than I deserve, but definitely let me know when your game is finished and in the market, because I want to check it out and see what you’ve accomplished!

Brent [import]uid: 200026 topic_id: 36126 reply_id: 143770[/import]

Any ideas? This is really important to the structure of my game. [import]uid: 73951 topic_id: 36126 reply_id: 143524[/import]

Hi @mort,
You might find the technique I outline in the following post to be useful. It basically lets you pass a display group as an argument to a function of another module, so you then know that objects created in that other module reside in a specific display group, and you can clean them up later from that group.

https://developer.coronalabs.com/forum/2013/02/12/removing-display-objects-memory-without-inserting-selfview

Best regards,
Brent [import]uid: 200026 topic_id: 36126 reply_id: 143548[/import]

@Brent Thanks a bunch, as always, for your prompt and concise responses. I may have to give you a “special thanks” credit in my game when it’s done! [import]uid: 73951 topic_id: 36126 reply_id: 143660[/import]

Hi @mort,
You’re welcome, always happy to help. Credit in your game would be more than I deserve, but definitely let me know when your game is finished and in the market, because I want to check it out and see what you’ve accomplished!

Brent [import]uid: 200026 topic_id: 36126 reply_id: 143770[/import]