How do I move player from one layout to another?

0 favourites
  • 11 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • I'm currently making a platform game in construct2, and I can't figure out how I'll move my character from the end of my level (layout1) to level2 (layout).

    I started using construct2 today, so I'm not experienced, any answers and solutions will be of great suppert. :)

  • Just make an object at the end of your layout like a door or something. Then in your event sheet for that level do something like this:

    +Player: Is overlapping (The object you made)

        -System: Go to layout (The next layout you want to go to)

  • What Wink said, but you also need to consider the actual player sprite object and how it gets to the new layer.

    Select the player sprite and look at the properties panel. In the first group you'll see a "Global" parameter. If this is "No", which is the default, then 2 things happen:

    a) The player object won't appear on the new layout unless you place it there, either at design time or by creating or spawning it.

    b) The instance variables for that player object are reset to the defaults in the new layout.

    However, if you have global set to Yes, then:

    a) The player object automatically appears on the new layout in the same position it was in in the old layout (but you can reposition it, of course.)

    b) The instance variables that changed in the previous layer retain their values in the new layout.

  • I am completely sure that I did everything right, but it still does not work... I have "System - Overlapping object: Portal Action Go to layout2. The player is also Global.

    I appreciate your replies. :)

  • Did you place your player on layout 2's level? I usually just drag him out of the Projects/Object Types window folder onto the level I want him on.

  • I wouldn't even bother making the player global. Just copy and paste the player into the layout you want just as you have it in the first layout but in the position you want it to start. Be sure to include the events for movement and such that you might have on layout 1 so everything's works. Also, consider making an event sheets with all of the player info that you can just right-click and include on every layout to keep you from redoing too many events.

    You can also have an invisible object where you want the player to start and on start of layout, create player at said object's position. You can then also use that object's position for respawning on death, too. In any case, the player sprite must get placed in the layout somehow and you should include necessary events for things to work.

  • isnt there stil an issue with creating objects thru events that dont already exist in the layout?

    So if your objects arent global your still gonna have to place them somewhere in each layout before you can create them with events

  • There only has to be at least one instance of each object in the entire game, not in each layout =)

  • I am completely sure that I did everything right, but it still does not work... I have "System - Overlapping object: Portal Action Go to layout2. The player is also Global.

    I appreciate your replies. :)

    System overlapping portal? Do you mean player?

  • i used a sprite to redirect on the one i am making, i have a trapdoor that opens when the last monster is killed, then the trapdoors opens as a another sprite, then the collision sends me to another layout

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It worked! :) Thank you everyone

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