Make something follow another thing correctly

So, I made a game where enemies chase the player. When the player or enemies go into the side of the edge, they come out on the other side.

But when the player does that, the enemy chasing them doesn't follow them. It turns around and heads the other direction to reach the player.
So, how do I make it so the enemy follows the player through the edge of the stage to come out on the other side, still behind them?

Maybe have sprite local variables that track the absolute x/y postions of the sprites - don't wrap them when they go over the edge - just wrap the the standard ones so that they come back on the other side

make sure the enemies move toward the absolute local var co-ordinates and not the visible ones

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.