0 votes

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.

Godot version 3.5
in Engine by (12 points)

1 Answer

0 votes

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

You can use wrapf() for this:
https://docs.godotengine.org/en/stable/classes/class_%40gdscript.html#class-gdscript-method-wrapf

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

by (21,714 points)

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.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.