We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code snippet reproducing the issue:
package; import flixel.FlxSprite; import flixel.FlxState; import flixel.group.FlxSpriteGroup; class MenuState extends FlxState { override public function create():Void { super.create(); var group = new FlxSpriteGroup(); var amount = 10; for (_ in 0...amount) group.add(new FlxSprite()); trace(group.length, group.countLiving(), group.countDead()); group.kill(); trace(group.length, group.countLiving(), group.countDead()); group.revive(); trace(group.length, group.countLiving(), group.countDead()); } }
Observed behavior: Last line printed is "10,0,10" Expected behavior: Last line should be "10,10,0"
This happens because FlxSpriteGroup.set_alive will check if the object "exists" before changing its value. A quick fix would be to swap those two line in FlxBasic so "exists" will be true when it tries too change the value of "alive".
Using FlxSpriteGroup for FlxGroup the result is as expected.
The text was updated successfully, but these errors were encountered:
can this be fixed? I'm running into issues because of this, and it seems like a very easy fix, it's been an issue for about a month now.
Sorry, something went wrong.
A quick fix would be to swap those two line in FlxBasic so "exists" will be true when it tries too change the value of "alive".
Sounds like a hack to me. I see no good reason why set_alive() needs to check for exists in the first place.
set_alive()
exists
c2ac5e5
FlxSpriteGroup: fix revive() not setting children's alive
1df6a5f
closes HaxeFlixel#1891
No branches or pull requests
Code snippet reproducing the issue:
Observed behavior: Last line printed is "10,0,10"
Expected behavior: Last line should be "10,10,0"
This happens because FlxSpriteGroup.set_alive will check if the object "exists" before changing its value. A quick fix would be to swap those two line in FlxBasic so "exists" will be true when it tries too change the value of "alive".
Using FlxSpriteGroup for FlxGroup the result is as expected.
The text was updated successfully, but these errors were encountered: