0 Favourites

Saving variables after restart

  • 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.

  • Construct 3

    Buy Construct 3

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

    Buy 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)
Similar Topics Posts Views Last Post
Unread hot topic
64 12,943
trollface's avatar
trollface
Unread hot topic
44 14,825
R0J0hound's avatar
R0J0hound
Unread hot topic
44 7,748
Ashley's avatar
Ashley Construct Team Founder