2D asteroids style map wrapping

I was trying something like @SparkyMcSparks but kept getting errors

My only question is if this is left and right and I do the same for up and down, do I just make have the red box surround the entire box? or only place top and bottom boxes that are similar to the left and right ones and simply have teleports on the sides as well as bottom/top and place teleports on the top and bottom of the side boxes…

I really hope that makes sense.

This also doesn’t rely on a specific screen size either does it? like the other solution does. I could see some errors if it does,