FlxGroup
is a way to separate, and layer FlxObject
s. This can be useful to ‘force’ your objects’ draw-order, or to help with overlap/collision detection, etc. You can optionally limit the number of objects a group can hold.
// create a FlxGroup called group, limiting it to 50 objects
var group = new FlxGroup(50);
// add sprite to group
group.add(sprite);