FlxG.collide not working when x>648
haxe, haxeflixel
Solution
Okay so I took a look at the HaxeFlixel source code (specifically the `FlxG.overlap` private function (line 363)), and I found that it only checks for objects inside the `worldBounds` `FlxRect`. After I knew that, all I had to do was set the bounds of that rect, which can be done with `FlxG.worldBounds.set(?X:Float = 0, ?Y:Float = 0, ?Width:Float = 0, ?Height:Float = 0)`.
Problem
So I was trying to create a platformer game using HaxeFlixel, but I ran into a problem: after a FlxSprite object's `x` value passes 648, `FlxG.collide` doesn't seem to work at all. Here is a gif of the problem. As you can see, it works fine when the player's `x` is < 648, but when it becomes greater the `FlxG.collision` stops working. The level is made of objects of the class `Wall` which extends `FlxSprite` with the only difference being that it's constructor loads the wall graphic and sets its `immovable` property to `true`. `FlxG.collide` is being called with `player` as the first argument and a `FlxGroup` (containing the walls) as the second argument. I'm not sure that it matters but the `FlxState`'s `super.update` is being called before `FlxG.collide`.