Hi all
I'm still getting used to the Haxe syntax, so this might be a dumb question...
If I'm using a foreach call on a FlxTypedGroup, is there a way to break out of the loop? Since I'm just passing through a function to call from an invisible while loop, I'm technically not in the loop itself, I'm just in the function that is being called:
forEach(function(enemy:FlxSprite) {
enemy.doSomethingFacy();
break; //error: break outside loop
});
Obviously the function above doesn't
need to call break, I'm just using it as an example.
My current workaround is to add a local 'processing' variable that I set to false and wrap around the function code, but it's pretty hacky. Is there a way of naturally breaking out of the FlxTypedGroup foreach?