Use FlxG.overlap()
to check if the bounding box of a FlxObject
(or any objects in a group) overlaps the bounding box of another FlxObject
(or any objects in the same or another group).
FlxG.overlap()
will return true
if it detects an overlap, and false
. if it does not.
// overlaps will be true if the two objects are overlapping each other
overlaps = FlxG.overlap(objectA, objectB);