Position between layouts?

For questions about using Classic.

Post » Mon Dec 26, 2011 12:23 am

Its been a while since I've been around here on the forums. I am just curious if there is anyway I can set my character position between frames.

I want to make somewhat of an overworld setting with buildings. If I go to the building door, I'd like to jump to the layout side said building. But if I exit the building, I would like my character to jump back to the overworld in front of that building.

I am guessing you can do this with global variables or something, but I'm curious to know if anybody has an easier solution
B
4
G
3
Posts: 36
Reputation: 997

Post » Mon Dec 26, 2011 9:56 am

You need 3 global variables e.g. "X", "Y", "Layout". X - is X position where player is spawned at the start of layout, Y - is Y position and Layout - will be number of layout where player is spawned. Also you'll have to create objects which will have same private variables(x,y,layout). Place them in the building entraces/exits. If player interact with them set global varaibles to private variables, player should go to layout number global('layout').
Well it's a solution which I used in my project. I think there are other ways to solve your problem.Wolod2011-12-26 09:57:35
B
54
S
11
G
4
Posts: 250
Reputation: 5,074

Post » Mon Dec 26, 2011 4:35 pm

Thanks for the reply. I figured that was what I would have to do but I was hoping there was an easier way to do it. Something like RPG maker where you pick which layout to warp to and then select the position on said layout to spawn the character.

I'll mess around with it and see what I can get out of this. Thanks again
B
4
G
3
Posts: 36
Reputation: 997

Post » Mon Dec 26, 2011 8:38 pm

What Wolod describes is probably the best way to do it. I showed a similar way, using arrays, in the Mikey's adventure tutorial part 4.
B
8
S
3
G
7
Posts: 835
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest