AxGroup.destroy();

Discuss suggestions to improve the Axel library.

AxGroup.destroy();

Postby Ramontique » Thu May 30, 2013 9:44 pm

If I want to destroy all entities within a group I can't call groupname.destroy() because this only marks the group itself as destroyed and not the entities within it. As soon as you revive the group, the entities that were alive before the destruction, will be revived as well.

Right now I need to manually iterate through all the members and destroy them when needed.

Is there anyway that this can be included within .destroy() or if that's not possible: to create a new function like: .nuke() ?
Ramontique
Sergeant
 
Posts: 25
Joined: Tue Nov 27, 2012 4:34 am

Re: AxGroup.destroy();

Postby Arkeus » Thu May 30, 2013 10:03 pm

https://github.com/arkeus/Axel/blob/mas ... up.as#L176

Looks like .clear() is what you want. If you don't pass anything it destroys all the members in addition to removing them. You can pass false to remove them all without destroying them also.

If you just want to destroy them all and not remove them from the group, iterating yourself is what you'd do (or add your own method to axgroup or subclass it and add it there).
Image
User avatar
Arkeus
Site Admin
 
Posts: 363
Joined: Mon Mar 26, 2012 12:43 am


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron