the loop thing is done by basically copying the levels on all 8 sides and seamlessly tp-ing the player ones they reach a certain threshold. The gravity rotation is just a scene rotation in Godot with a smoothstep lerp