0 votes

So apparently this is harder to do then i thought it would be.

I'm trying to seamlessly wrap my level around x & y.
So once the player gets to (3000,500) they will then end up back at (0,500)

I originally was just going to have the player object do a set_pos() once it got outside that coord, however i'm realizing now that the player needs to see the objects past the wraparound point before he crosses it. It can't be a sudden jump like i was originally thinking. Is something like this even possible in GODOT? And if so, how would one go about doing it?

--EDIT--
I probably should have mentioned it's going to be multiplayer

in Engine by (27 points)
edited by

2 Answers

+1 vote

I'm thinking you will need to have 2 copies of your 'level', placed side by side (assuming its scrolling sideways?), and once your character passes a certain threshold (at which point the first level can no longer be seen) remove it. Or you could just make the original level partially looped itself (e.g. it has a small part of the beggining (x=0) tacked on at the end (x=3000) and once you move far enough so you cannot see behind x=0, you then do the warp and it won't appear sudden (though everything else needs to be warped too).

by (16 points)

Thanks, I had heard this idea before, but i'm not sure how that will work if it's multiplayer. I guess you would just have to have the player object and the mirrored objects move in sync. That just seems like a really clunky way of doing it.

+1 vote

Maybe you could break your level up into a set of pieces, say 3, or 6, (or choose whatever makes sense for it).

Then, as the player moves across the level you "add" the pieces to the end of the level the player is on, and remove levels at the beginning as the viewport moves.

by (16 points)

I was going to say this too, and don't remove the parts, just move them, add triggers, when enter the screen, move the sections to the corresponding place.

Maybe you can use a Node2D as root of the sections and keep reparenting them on the same relative positions.


Some solutions may work better or worse, depending on your design.

This one, for example, may require objects and enemies restricted to a level section.

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 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 webmaster@godotengine.org with your username.