2d Wraparound game space ?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By AncientSion

In a 2d side-view shoot em up with free movement, i would like to have a wraparound game space instead of fixed boundaries at say X:0 and X:2000

I have no idea how to accomplish this, please advise.

:bust_in_silhouette: Reply From: kidscancode

Wrapping is a matter of “teleporting” your object’s position to the opposite side when going off-screen.

You can use wrapf() for this:

Code example: http://kidscancode.org/godot_recipes/2d/screen_wrap/

Thats really not what i was asking i dont think.
Imagine playing super mario brothers but instead of getting to the pole flag, you eventually end up at the starting position (the entry castle) again.

AncientSion | 2022-09-09 09:58