If you look at the sides of the screen you will see a path that goes "outside of the game". They're connected, so if you go to the right, when you get one tile outside of the tilemap ( (width_in_tiles + 1 )*50 ), pacman changes his x to -50 and reappears from the left. It goes smoothly.
However, when I try the same thing with the left path, Pacman stops at the extreme (like you can see in the image), as if it collided with an non-existent wall.
When I debbuged, I saw that there was a FlxTile just in front of Pacman, blocking his movement. The fun part is that it wasn't always there: When I checked the _tileObjects variable in the FlxTileMap, I noticed that none of the members were in that position prior to the collision, it was moved during it.
The problem is in this line in FlxG
var result:Bool = quadTree.execute();
The quadtree moves the FlxTile 14 of _tileObjects just in front of Pacman - independently of his Y value - for no reason.
I suspect that it might be because Pacman's X gets lesser than 0 for a moment, and it somehow messes with the quadtree function. But then again, if you go to the right, Pacman will come from the left without colliding with anything.
I have made a temporal solution, but I will like to know if there is any know way around this problem.
Thank You.