toroidal 2d level

Good afternoon. I have a question. My friend and I are making a 2D game similar to Starbound. We wanted to create a looped world, but we’re facing a problem. We can either make the world in the form of a cylinder or use a teleport at the ends. However, I don’t know how to implement either option. In the cylinder, I don’t understand how to wrap the tile set into a cylinder, and in the second option, I don’t know how to implement enemy movement and physics. Can you please tell me how to do it correctly? I tried to search for information, but I couldn’t find it. I even tried to contact a neural network, but it gets confused and doesn’t always provide the same information, and sometimes it’s unclear what it means.