Hi there. i checked the forum to see if this problem was solved but couldnt find any answers. I am trying to make a gameworld that ll wrap around it’s self to be viturally infinite. In example the player will return to the starting point if he moves contiunesly towards one direction. Simply traveling the player entitiy wont work as in Pac-Man since i am using a camera fixed on the player. Even if it makes such a jump it has to be invisible.
Endless game world
you want your player teleport instantly to other side? or you wanna see half of player in both sides when touching to borders?
EDIT: Sorry for quick answer, i’m thinking about it, i got right now what’s your problem exactly.
UPDATE: I think your problem is, your player’s collision check. I think you’re using standart collision check for your player to teleport it to other side. But in this case, you shouldn’t calculate player’s “hitbox”, you just try to create a function only using your player’s “x” and “y” positions because you need pixel precision for that.
this is pretty easy thing to do. first create a level witch matching edges. then create trigger entities that will teleport any entity including player that will enter in their area to other edge of the level. such trigger should have at least 3 properties: area, deltaX and deltaY. its update function should check if any entity is in the area, if it is trigger should adjust its position according to deltaX and deltaY. note that you will need at least 4 of such triggers - one for each edge. it is also important to teleport entities in front of opposite trigger so you wont fall into infinite loop.
If you set your map to tile and always teleport to one map width forward or backward, you shouldn’t notice any transitions. You should be able to set your map graphic to automatically tile as well.