Who said anything about rotation? I mentioned how to visualise which parts of the map would be connected to give it a topology similar to that of a sphere (either fold the map along the line of 0 latitude and imagine the edges are joined together, or imagine a cylinder with the caps sewn shut).
Here's some pseudo-code for that. Map your coordinates into the range -1 to +1 (-1 on the X axis would be the West edge, +1 on the X axis would be the East edge, +1 on the Y axis would be the North edge, -1 on the Y axis would be the South edge).
if(x > 1) x = x - 2; // maps x = +1 to x = -1
if(x < -1) x = x + 2; // maps x = -1 to x = +1
Wrapping by going North:
if(y > 1) x = -x, y = 1 - (y - 1); // reflect x coordinate in y axis (i.e. the line x = 0) and reflect y coordinate around line y = 1
1 - (y - 1) simplifies to 1 - y + 1 = 2 - y
Wrapping by going South:
if(y < -1) x = -x, y = -1 - (y - (-1)); // reflect x coordinate in y axis and reflect y coordinate around line y = -1
-1 - (y - (-1)) simplifies to -1 - (y + 1) = -2 - y
Example: you move off the south edge of the map and your x, y coordinates would have placed you at (0.6, -1.25). Your new coordinates would be (-0.6, -2 - (-1.25)) = (-0.6, -0.75)
EDIT: It is possible to cross both east/west and go off the top or bottom in the same move. Solve this by checking for going off the east or west edge first, adjust the x coordinate, and then check the new position against the top and bottom of the map.
Yes, I got it) Thanks!
And what should I do with my camera? I've got a 2d game with non-rotation camera (like old FF). This impementation means that when player crossed -1 point at Y axis, camera and player simply moves into new location? It seems not so seamless as I imagine... But there is only one way to do it?
Hoping for your help,
P.S. Sorry for my English =)