system
September 9, 2022, 1:17am
1
Attention
Topic was automatically imported from the old Question2Answer platform.
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.
system
September 9, 2022, 1:30am
2
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:
Built-in GDScript constants, functions, and annotations. Description: A list of GDScript-specific utility functions and annotations accessible from any script. For the list of the global functions ...
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