How do I Smoothly transition between layouts?

Get help using Construct 2

Post » Wed Nov 16, 2016 11:40 pm

I'm working on an arcade platformer where the player can teleport between several worlds (I'm using layouts for each world). I am looking for a way to smoothly transition between the layouts while keeping the player position relative to before they teleported. Currently when they hit the teleportation it starts them at the beginning of layout and its too jarring to keep in the game.

Should I be using layers? I need help.
B
26
S
13
G
3
Posts: 11
Reputation: 3,925

Post » Thu Nov 17, 2016 12:04 am

So you mean keep them in the same place they were when going between layouts? You can store the playerxy position as global variables on leaving a layout and then on the new layout set the position to the global variables for xy.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Thu Nov 17, 2016 12:37 am

Yes! As if they were phasing between worlds but remained in the same position.

Did you mean something like this? I couldn't get it to work.

System| on end of layout| System| Set PlayerX to Player.X
| System| Set PlayerY to Player.Y

System| on start of layout| Player| Set position to (PlayerX, PlayerY)
System| World \= 0|
B
26
S
13
G
3
Posts: 11
Reputation: 3,925

Post » Thu Nov 17, 2016 12:39 am

Could be because I am only using one event sheet?
B
26
S
13
G
3
Posts: 11
Reputation: 3,925

Post » Thu Nov 17, 2016 6:59 am

If you make the player sprite a global object it will remain in the same position when transitioning layouts.
B
19
S
5
G
3
Posts: 85
Reputation: 2,793

Post » Thu Nov 17, 2016 9:08 am

Well usually you will have an event sheet linked to each layout but up to you really. Your logic seems fine, I don't use end of layout though, maybe that is too late or maybe it works. Check if the global variables update in debug mode.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Thu Nov 17, 2016 6:57 pm

Thanks! Setting the player box and sprite to global variables has helped. Now I just need to make the transition a little smoother.
B
26
S
13
G
3
Posts: 11
Reputation: 3,925

Post » Thu Nov 17, 2016 8:40 pm

Well the transition should be instant if you are using go to layout.
B
47
S
17
G
81
Posts: 2,221
Reputation: 48,089

Post » Fri Nov 18, 2016 5:26 pm

oh it is. Haha, I am trying to add a brief slow motion effect to the player and have the backgrounds fade in as they enter the new layout.
B
26
S
13
G
3
Posts: 11
Reputation: 3,925


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests