Tag Info

Hot answers tagged

12

This system with all these triggers sounds a bit too complicated and error prone. You could wrap the position of the player using modulo with something like playerPositionX = playerPositionX % mapWidth This way when your player reaches playerPosition == mapWidth the playerPosition will reset back to 0. This solution could be extended with the whole ...


10

The canonical solution is to use portals. In your example, there is only one level, except there is a portal connecting the left and right ends. Anything moving across that portal will have its coordinates translated to the other end of the portal, so that if something is moving left through the portal, it will reappear on the right side of the level and ...


6

Remember that what you display on screen, and what's in memory are two totally different things. Imagine you have a window that you need to fill with data about the world. You fill the window from left to right. While you're parsing your data to fill the world, if you reach the end of the world, simply loop back around to the beginning of your data. Using a ...


2

Disconnect the rendering from the world and you can do wraparound and correct rendering without resorting to any cloning or teleporting artifacts. First, in your world you have a fixed size world, from 0 to Width. Anytime an object goes below 0 you wrap it to the end, and anytime an object is over Width wrap it to the start. This means that all logical ...


2

Not sure how those games solved it. But I just read the write up of how Dungeon Siege solved this for multiplayer was to keep things in their local region space and for each frame, turn things to a local space based off one region. Therefore you don't have a single numerical space for the whole game. You should take to time to read the write up. Super ...



Only top voted, non community-wiki answers of a minimum length are eligible