FlxGroup vs Array
Hi! HaxeFlixel newbie here. I was just wondering exactly when to use FlxGroup over a regular array. I'm currently doing that only when I know that I can make use of some API function that uses a FlxGroup - what are some other usage tips?
FlxGroupcan be added to other groups/states, so update() and draw() are called on all the members of the group with
exists == true. Be careful, adding to two groups can lead to update() called twice resulting in 2x simulation speed (can be solved by marking the group
active = false).
arrayswhen you don't want to update/draw sprites, or they are updated/drawn from other group already.
And also, as you said, use
groupswhen APIs demand FlxGroup, like for object recycling or collision.