This is a very simple solution for 2d arcade games you can implement with just one line of code in your sprites (if you add the funcion in your global.gd file)
1) add this function in your sprite (scene) code or in global.gd file
obj can be any scene that includes the "position" property like Area2d or KinematicBody2D
diff_x and diff_y the no. of pixels the object position can be outside the border before been warped
func test_and_warp(obj, diff_x, diff_y):
if (obj.position.x < (0 - diff_x)):
obj.position.x = global._SIZE.x
elif (obj.position.x > (global._SIZE.x + diff_x)):
obj.position.x = 0
if (obj.position.y < (0 - diff_y)):
obj.position.y = global._SIZE.y
elif(obj.position.y > (global._SIZE.y + diff_y)):
obj.position.y = 0
2) execute it in the process function of the object (scene) to check and warp, for example:
func _physics_process(delta):
--> here move your sprite, then test the new position:
global.test_and_warp(self, 4, 4)