goto specific coordinates in next layout

Get help using Construct 2

Post » Wed Feb 29, 2012 8:25 pm

Hello! Just wondering if someone can tell me how I can make my character goto specific coordinates in the next layout. Also if someone could tell me if there are any layout to layout transition effects.

Will continue to search forum for previous post, havent found anything yet though..

Thanx
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Wed Feb 29, 2012 8:48 pm

I'm not sure if I've understood you correctly but would this not work:

On start of layout > Set 'character' position to X, Y
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Feb 29, 2012 9:05 pm

maybe if there was only one way exits.. But if I exit layout1 into layout2 and then go to another exit in layout2 into layout3 this also has to work in reverse order so that when I return from layout3 into layout2, I appear at the correct place in layout2 and not the one I came through when exiting layout1. Hmm.. Ill try to illustrate :)
B
21
S
7
G
4
Posts: 221
Reputation: 5,070

Post » Wed Feb 29, 2012 9:09 pm

Use two global variables to set the position. Set them right before using "go to layout", and then use FredQ's idea.
B
79
S
24
G
54
Posts: 4,750
Reputation: 40,763

Post » Wed Feb 29, 2012 9:27 pm

You could change layouts by global variable... Then add a subevent for each particular level assuming the character position is going to be different everytime.

Although I'm not sure why you can't just put the character on each layout in the position that you want him to be when the layout starts.

Anyway I hope these screenshots will be useful...


Progress level by variable




Level Specific Action - Sub-event where you would set position of character

FredQ2012-02-29 21:35:36
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Wed Feb 29, 2012 10:17 pm

Yeah. All you need to do is set two global variables for X and Y (or one if you want to do something like "door number")

I would do it the second way. Have a certain amount of doors in your 'meta-layout'. Give every door a variable ("door_number") and a destination text variable("destination") and give matching doors the same value.

So it becomes: On collision with door -->
-Set global variable (door_temp or something) to door.type
-Go to layout by name (door.destination).
Then
[on start of layout
For each door
door.type = door_temp] -->
-door: create player.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Justin1967 and 22 guests