Endless loop scrolling wrap layout?

Just started using Construct 2? Post your questions here

Post » Wed Jan 06, 2016 8:44 am

On Sonic the Hedgehog 1 for the Genesis, there is a part on one of the labyrinth levels where the level wraps around until you throw a switch, and on Mario (3 I think?) there is a similar trick on a Bowser level and you have to pick the right path or else the game beeps and you wrap around the layout. How can this be achieved in c2? It's not quite as simple as resetting the player position as there are no strange jumps. Any ideas what tech could be used to do this trick?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Wed Jan 06, 2016 9:41 am

The two ways I've used to do that are either:
* move the player if he exits either end of layout. Scrolling is unbounded and the seam is hidden by either carefully placing objects in the same places on either end or using the paster object to copy the other side. It just to make the transition appear seamless.

* move everything under the player instead of the player. And just wrap the pieces as the leave the layout.

Both those take care of the visual portion. The seam will be a problem with ai and such so you'll have to take that into consideration with your events.
B
94
S
33
G
118
Posts: 5,392
Reputation: 75,845

Post » Wed Jan 06, 2016 12:17 pm

I used the first method R0J0hound mentioned for a 1-hour game jam entry:

https://dl.dropboxusercontent.com/u/523 ... eMaze.capx (you'll need his Paster plugin)

It uses a Level Bounds sprite, definining the world wrap seams, & 8 paster objects around it. In retrospect you'd only need one, looping around the 8 positions - you don't get much time to think in a 1HGJ!
B
27
S
12
G
1
Posts: 157
Reputation: 3,359

Post » Thu Jan 07, 2016 11:42 am

R0J0hound wrote:The two ways I've used to do that are either:
* move the player if he exits either end of layout. Scrolling is unbounded and the seam is hidden by either carefully placing objects in the same places on either end or using the paster object to copy the other side. It just to make the transition appear seamless.

* move everything under the player instead of the player. And just wrap the pieces as the leave the layout.

Both those take care of the visual portion. The seam will be a problem with ai and such so you'll have to take that into consideration with your events.

I think the first method makes sense, if unbounded scroll is trigger-able, so when your reach that part of the level it turns bounding off, then you could proceed with the section that wraps. As so matching AI, I don't think either of my examples need that:

https://youtu.be/QcfyypW65BM?t=24
https://youtu.be/s-J3M33cDNw?t=8

Neither have anything that would be different on a wrap, so I think it could be done that way. Would use paster be essential or could it be done with creative triggering?
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Thu Jan 07, 2016 12:18 pm

Zebbi wrote:
R0J0hound wrote:The seam is hidden by either carefully placing objects in the same places on either end or using the paster object to copy the other side. It just to make the transition appear seamless.


Would use paster be essential or could it be done with creative triggering?


Did you really read the answer?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jan 07, 2016 2:31 pm

LittleStain wrote:
Zebbi wrote:
R0J0hound wrote:The seam is hidden by either carefully placing objects in the same places on either end or using the paster object to copy the other side. It just to make the transition appear seamless.


Would use paster be essential or could it be done with creative triggering?


Did you really read the answer?

Of course I did, I was just clarifying that it could be done without paster, I must have read the or as an and.
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Thu Jan 07, 2016 9:53 pm

@Zebbi
To do it without the paster object just make sure the areas on either side of the layout look identical.
https://www.dropbox.com/s/hds0a0y1woh6q ... .capx?dl=1
/examples31/loopScroll.capx
Last edited by R0J0hound on Mon Oct 23, 2017 11:27 pm, edited 1 time in total.
B
94
S
33
G
118
Posts: 5,392
Reputation: 75,845

Post » Thu Jan 07, 2016 11:58 pm

R0J0hound wrote:@Zebbi
To do it without the paster object just make sure the areas on either side of the layout look identical.
https://dl.dropboxusercontent.com/u/542 ... croll.capx

Thanks, that's a perfect example!
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Post » Sun Oct 15, 2017 10:48 am

R0J0hound wrote:@Zebbi
To do it without the paster object just make sure the areas on either side of the layout look identical.
https://dl.dropboxusercontent.com/u/542 ... croll.capx


can you reupload that? thankyou
B
11
S
2
Posts: 16
Reputation: 738

Post » Fri Oct 20, 2017 6:14 pm

orangpelupa wrote:
R0J0hound wrote:@Zebbi
To do it without the paster object just make sure the areas on either side of the layout look identical.
https://dl.dropboxusercontent.com/u/542 ... croll.capx


can you reupload that? thankyou

If r0j0 doesn't, I'll see if I still have the capx on my laptop later...
B
41
S
12
G
14
Posts: 1,122
Reputation: 11,282

Next

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 2 guests