Is there anyway to change the wrap behavior?

Post » Tue Oct 24, 2017 2:50 pm

When an object wraps around, it kind of goes off screen first then wraps around.

https://imgur.com/a/Iu3IM

Here you can see that the object is partly outside. Is there a way to change that?
B
76
S
12
G
7
Posts: 418
Reputation: 9,325

Post » Tue Oct 24, 2017 6:45 pm

Use a separate identical sprite that you position manually.
So say the screen width is 640

player.x < 320
--- clone: set position to (player.y, player.x+640)
else
--- clone: set position to (player.y, player.x-640)
B
95
S
33
G
128
Posts: 5,491
Reputation: 81,570

Post » Tue Oct 24, 2017 9:14 pm

That's very creative thank you.

The other issue though is if you have a block on the other side. you actually of off-screen first and it just looks a little weird. It would be better to do this automatically.

It would be better to have the sprite not go offscreen before wrapping.
B
76
S
12
G
7
Posts: 418
Reputation: 9,325

Post » Tue Oct 24, 2017 9:45 pm

You're probably better off just duplicating obstacles off screen to handle that.
B
95
S
33
G
128
Posts: 5,491
Reputation: 81,570


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests