It looks like you're new here. If you want to get involved, click one of these buttons!
Hello, I setup orx this weekend and am really enjoying it....everything works as advertised so far.
My basic questions is - what is the recommended way to iterate through all orxOJBECTS and remove them (for exiting a level of game play, for example). More context below:
I've setup a simple system to allow navigation between various "levels" - for example, a main menu with ability to quit or proceed to Level 1. My Level 1 is a simple Space Invaders style game. While this level is in play, I want the user to be able to hit Esc to return to the main menu. This works fine, but I'm having trouble getting rid of all of the objects used in level1 before switching to the main menu. So a couple of questions:
To remove objects, I'm using orxObject_SetLifeTime(MyObject, 0);
It works well for removing objects I have references to, but I'm curious if that is the orx-like way to do it, or if there another recommendation.
To remove children of a parent object (my enemy fleet is composed of a single object with a bunch of children enemy objects), I've found how to iterate through the children and set their lifetimes to 0, so that works well to remove my enemies when the user returns from level 1 to the menu.
The problem is with my player's missiles...they are setup with a simple spawner that activates when the spacebar is pressed (pretty much the same as in the Beginner's guide). If I launch a bunch of missiles then return to the menu, I'm not sure how to find those objects and remove them since I don't have references to them.
Sorry for the long-winded message. I assume there must be a master list of objects that can be iterated for this purpose, but I haven't found it in the short amount of time I've spent looking around.