I have a hero, an enemy and bullets.
lots of Bullets are in a FlxGroup
1(one) Enemy are in a FlxGroup
Enemy walks to the right constantly.
In the update method of the PlayState I have:
public override function update():void
FlxG.collide(bullets, enemys, onCollidesBulletsEnemys);
The soldier stop colliding with the enemies when both are beyond FlxG.width value. Same with bullets.
I try changing the size of the canvas and always the collision stop working as I said.
yea, by default FlxG.worldBounds is set to roughly the size of the screen - if you change the size of the worldBounds you should be ok!
Works. Using this code on the constructor.
FlxG.worldBounds.width = _level.width;
FlxG.worldBounds.height = _level.height;