Position between layouts?

This forum is currently in read-only mode.
  • 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

  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)