How do I resume game progress ?

  • Hello everyone ,

    i have a little problem . one of my events is not working , "when "Sprite73" is clicked" --- Go to layout "LevelCleared" (LevelCleared is an attribute and it's value is 0 it go up by 1 every level)

    when it come to testing , when i click on Sprite73 nothing happen . Do you have a fix for this ? or another ideas to make the player continue in his last level ?

    level name are like that : 0 , 1 , 2 ...

  • You mean LevelCleared a global variable number and your layouts are numbered without anything else?

    Then it would be goto layout by name: LevelCleared (without " around it)

    If your layouts are called Layout 1, Layout 2, etcetera (the way Construct2 names them automatically)

    Then it would be goto layout by name: "Layout "&LevelCleared (don't forget the space after Layout)

  • fixed it , the trick was to make another attribite which is a text not a number

    LevelsPassed: is a text

    LevelsCleared: is a number

    so it become like that :

    when level is switched for example : add 1 to LevelsCleared

    Every Tick : set LevelsPassed to LevelsCleared

    When mouse is clicked on Sprite 73 : go to layout "LevelsPassed"

    I hope someone else find this useful . Close the topic please .

  • LittleStain

    Oh sorry , didn't saw your reply . Thanks anyway .

  • fixed it , the trick was to make another attribite which is a text not a number

    LevelsPassed: is a text

    LevelsCleared: is a number

    so it become like that :

    when level is switched for example : add 1 to LevelsCleared

    Every Tick : set LevelsPassed to LevelsCleared

    When mouse is clicked on Sprite 73 : go to layout "LevelsPassed"

    I hope someone else find this useful . Close the topic please .

    Like explained above, no need for the LevelsPassed, you can just set the goto layout to Levelscleared without "

  • it's without the "" from the start ...

    like i said this didn't work for me , umm i wonder why

  • Ok, first time I noticed this..

    Goto layout by name : ""&LevelCleared does work, but just LevelCleared doesn't..

  • Ok, first time I noticed this..

    Goto layout by name : ""&LevelCleared does work, but just LevelCleared doesn't..

    as i said in the main post , their names are 0 , 1 , 2 , 3 , 4 ... without the default "Layout" thing

    and LevelsCleared is 0 by default

    But it's working now ( with LevelsPassed and LevelsCleared ), so you don't need to worry

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ahh i see now , i'll try it

  • Yup , it work like that . Thanks very much . i'll need that spare event from my limited 100

  • Yup , it work like that . Thanks very much . i'll need that spare event from my limited 100

    Officially you should use str(LevelsCleared), which turns LevelsCleared into a string..

    Just so I don't teach you the wrong way..

  • Umm , can i ask you why ? isn't string for counting word letters or something ? or is it the value that is turned to a string

  • Str(value) turns the value into a string..

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