Go to 'next layout'...

0 favourites
  • 7 posts
  • Hi there. So far this forum has been really helpful in solving any problems I've had, so lets have another go...

    For the type of game I am creating I can basically use the same event sheet throughout for all of my layouts if it wasn't for one problem.

    Upon the ball reaching the target I would like the option to go to next layout. However, I have to select a specific layout by name. This means that for each level, the layout that proceeds is different so I have had to create a new event sheet for each layout with a complete copy of events apart from this one event directing the player to the next level or layout.

    I know another option would be to create multiple versions of my target/goal, and create several events in one sheet so depending on which level the player is on, the target in question will lead to the appropriate layout that follows but this is a bit tedious.

    I think it would be much more convenient if the order that the slides appeared in the project browser were the order they were read by the game, so a simple 'Go to next layout' or 'Restart current layout' would be a great help.

    I hope I've explained that clearly enough and apologises in advance if there is an easier way that is staring me in the face that I have missed.


  • For a few releases now, you have a system action "Go to layout (by name)" that allows you to write down the layout name (and so being able to use variable as well).

  • I did notice this, but I couldn't find anywhere that explained about how I would proceed to the next layout relative to the current one.

    So what would I need to type into here to proceed to the next layout? Keeping in mind the fact that I would use this same event sheet for all layouts.

    And also, upon the ball hitting the spikes, how would I restart current layout?

  • Use a global var "Level".

    When you want to restart the current level :

    Go to layout by name : "Layout" & Level (for C2 this will mean "Layout0", "Layout1", "Layout2", etc...)

    For the next level, it is the same thing, just make sure to add 1 to Level on the end of level condition.

  • Sorry to bump this after quite a while but I got distracted. But I have since tried to implement this and can't seem to get it working.

    Can anyone with a spare couple of minutes just throw down the events into a simple capx for me please? It would be massively appreciated.

    Thanks in advance

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Just want to throw in that you can include all your common events with an event sheet include. Then, you can add any level-specific events for each layout beneath the include. For example, just a single event to go to which ever layout you want to be the next one when the level's complete.

  • You need to add str(Level) to work.

    I know is a old thread but I am posting for myself.:D

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