Saving variables after restart

0 favourites
  • 2 posts
From the Asset Store
Easily store, modify, read and manipulate colors with Color Variables!
  • I'm working on a game that has the player race to a goal while dodging obstacles, and after reaching the goal successfully an amount is added to the total score based on how long it took, and the level is started over. You keep doing this until you eventually hit an obstacle and crash.

    I'm having a problem though storing the score between these restarts triggered after hitting the goal.

    When the layout is restarted, so are all the variables.

    It might also be nice to use a variable to limit the number of restarts.

    Does anyone know what needs to be done to store the variable between restarts?

    -Edit-

    It seems I was completely mistaken about the cause of the issue.

    Global variables seem to be stored between restarts, but trying to set text in the same event as a restart does not work for some reason.

    All I had to do was change the text set action to occur on layout start rather than just before it gets restarted.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello There, please update the title of this post to have [Solved] at the beginning so other who may have a similar issue can more easily see it as useful.

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