Advertisement

Stargate/Defender Background Wrap

Started by April 02, 2020 08:00 AM
6 comments, last by Alberth 4 years, 7 months ago

I've seen plenty of tutorials and examples showing how to wrap from one side of a s ingle to screen to the other, but I need something smoother and something that I can use with a parallax background.

Currently, I'm using wrapf() to wrap the parallax background and that works, functionally, sort of... However, it clips and just totally looks wrong. My ship jumps from one screen to another with no view of the upcoming screen. It's kind of difficult for me to describe, but the effect I want is used in several existing games. Basically, I need part of each screen (the current screen that the ship is in and the screen that the ship will wrap to) to both be visible (again, partially) while the ship transitions. I need the wrap to begin happening before my ship gets there.

Eventually, I'll include a minimap too, and that will also need this effect.

Just the x axis…

Any ideas? The simpler the better…

None

This thread was started in the wrong place but now it's in the right place. (It was posted in Artificial Intelligence, and this isn't an A.I. question.)

-- Tom Sloper -- sloperama.com

Advertisement

Ajay47 said:
wrapf()

If you are using Godot then you should mention it somewhere. I would recommend putting it in the title.

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

@Tom Sloper : Yeah, I know, I couldn't figure out how to change it after I posted. Thanks.

None

@fleabay : Yeah, sorry, I'm new here… I thought this forum was for godot… my bad.

None

BLEH! *FACEPALM*

I can't figure this out, or even an alternative. It's so central to what I want to do! Grrr…

None

Advertisement

I am not a Godot user, and have no idea what wrapf() does, but you want a horizontal world where the far left end is connected to the far right end so you can move around in circles, right?

I would probably make not 1 world, but 2 ½ worlds (or 3 ⅓ worlds, etc). For simplicity assume one such world part is at least as wide as the screen (not strictly needed but it makes the explanation simpler).

Each world part is showing just its own part. You must be able to display a part at any horizontal offset of the screen. Eg, one part starts at ¾ of the screen, or it shows its last 1/5th (and being longer than the screen width, starts off-screen). Second, be able to show more than one such part at the same time. If one part is wider than the screen, you can have at most 2 parts displayed at the same time (both partially for instance). If a part is less wide than the screen you always have at least 2 parts displayed, and possibly more.

Your wish is simple then. Just show the relevant parts at the correct offsets. You have full control since you decide the offsets of each displayed part. You likely need to synchronize offsets of the parallax background between the parts to make it look good.

This topic is closed to new replies.

Advertisement