help with levels

This forum is currently in read-only mode.
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • hi i am a newbie at construct and im wondering if somebody can make a tut how to make levels you know if you kill all the enemis you complete the level and then you start another level. thanks

  • Check out deadeyes platform tutorials. That basically covers what you're asking. But be sure to use the version it was made for.

  • Check out deadeyes platform tutorials. That basically covers what you're asking.

    Actually, no it doesn't. I don't have any tutorials on how to switch levels yet.

    You need to make another layout for your second level. Then basically all you need is a condition (like comparing the number of enemies to 0) and the System action "Go to Layout." It's not too hard.

  • To make that more clear, if you have 10 enemies, make a variable called "#ofEnemies" and set it to 10 and every time an enemy dies subtract 1. Then make an event that says when #ofEnemies equals 0 goto the next layout.

  • What about the .Count expression? You access it with the "Get number of objects" in the expression editor, or just type ".Count" after your object name.

    System: Compare: Enemy.Count = 0

    No need for a private variable, unless you want something more complicated.

  • What about the .Count expression? You access it with the "Get number of objects" in the expression editor, or just type ".Count" after your object name.

    System: Compare: Enemy.Count = 0

    No need for a private variable, unless you want something more complicated.

    thanks

    but now how do i make like another level . when i make a new layer its the same map and everything and when i delete something from the layer the thing i deleted delets in the other layer to.

  • You need to make another layout, not another layer. Right-click the layouts folder in your project list and craete a new one.

  • You need to make another layout, not another layer. Right-click the layouts folder in your project list and craete a new one.

    ok i did a new layout as you told me to and it worked but now im expericing another problem when i create another layout the event sheet is gone .. and i cant copy the event sheet from the other layout. what can i do besides doing the event sheet all over again.. ?? thanks for the help so far

    im sorry if im bugging you.

  • You should put all of your game code in a separate event sheet and then include the event sheet for each layout. You can create a new event sheet by right clicking the "Event sheets" folder in the project bar and clicking "Add event sheet". This is the event sheet where you should put your non-level specific game code. Then, to include the event sheet, right click in your layout's event sheet and click "Include event sheet". From there you can include your gamecode event sheet. Here's an example of an included event sheet:

    Included event sheet

    Hope that helps.

  • It's also possible to set different layouts to use the same event sheet, without needing to use "include event sheet" on each.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's also possible to set different layouts to use the same event sheet, without needing to use "include event sheet" on each.

    could you tell me how?

    Edit: nevermind i saw how to do it now

  • What about the .Count expression? You access it with the "Get number of objects" in the expression editor, or just type ".Count" after your object name.

    System: Compare: Enemy.Count = 0

    No need for a private variable, unless you want something more complicated.

    when i do that then everytime i kill all enemies i come to layout 2 and i cant have more than 2 levels what shall i do?

  • What do you mean you can't have more that two levels? What's happening?

    Perhaps it would be easier to help if you posted your .cap file.

  • Hmm, well, you could add a global variable, call it something like level. Then use:

    System: Compare: Enemy.Count equals 0

    • Global: Add 1 to level
    • Go to layout global('level')

    and make sure the variable level is set properly at the start of the game (its initial value can be changed in the project view).

    Hmm.. if you have your layouts named logically, Level 1, Level 2, Level 3, [...] Level 10, Level 11, etc., you could do this instead:

    System: Compare: Enemy.Count equals 0

    • Global: Add 1 to level
    • Go to layout "Level " & global('level')

    OR, instead, an alternative, hackish, probably unnecessarily complex way to do it, one I'd recommend against unless all else fails:

    You could place an object named LevelInfo on each level, outside the visible play area, or just invisible.. with its own private string variable, NextLevel, and for a value use the name of the next layout, like Level 1's LevelInfo would have the value "Level 2". Then copy your LevelInfo object. Go to layout Level 2, and paste it, then change the variable value to "Level 3", etc.

    Then you'd use: Go to layout LevelInfo.value('NextLevel')

    There's surely a better way to do it than this last one, though.

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