diff --git a/src/org/flixel/FlxBasic.as b/src/org/flixel/FlxBasic.as index 70788363..5b4b85e5 100644 --- a/src/org/flixel/FlxBasic.as +++ b/src/org/flixel/FlxBasic.as @@ -126,6 +126,9 @@ package org.flixel * However, if you want the "corpse" to remain in the game, * like to animate an effect or whatever, you should override this, * setting only alive to false, and leaving exists true. + * + * When used in a FlxGroup, the method will kill the group, but leave + * the members alive; use FlxGroup.killAll() to kill any members. */ public function kill():void { @@ -136,6 +139,9 @@ package org.flixel /** * Handy function for bringing game objects "back to life". Just sets alive and exists back to true. * In practice, this function is most often called by FlxObject.reset(). + * + * When used in a FlxGroup, the method will revive the group, but leave + * the members as they were; use FlxGroup.reviveAll() to revive any members. */ public function revive():void { diff --git a/src/org/flixel/FlxGroup.as b/src/org/flixel/FlxGroup.as index 37051c71..3ea403e4 100644 --- a/src/org/flixel/FlxGroup.as +++ b/src/org/flixel/FlxGroup.as @@ -555,36 +555,28 @@ package org.flixel } /** - * Calls kill on the group's members and then on the group itself. + * Calls kill() on all of the group's members (but not on the group itself). */ - override public function kill():void + override public function killAll():void { - var basic:FlxBasic; var i:uint = 0; while(i < length) { - basic = members[i++] as FlxBasic; + var basic:FlxBasic = members[i++] as FlxBasic; if((basic != null) && basic.exists) basic.kill(); } - - // Kill the group itself - super.kill(); } /** - * Calls revive on the group itself and then on the group's members. + * Calls revive on all of the group's members (but not on the group itself). */ - override public function revive():void + public function reviveAll():void { - // Revive the group itself - super.revive(); - - var basic:FlxBasic; var i:uint = 0; while(i < length) { - basic = members[i++] as FlxBasic; + var basic:FlxBasic = members[i++] as FlxBasic; if((basic != null) && !basic.alive) basic.revive(); }