How do I save the stopwatch time and then place it in another layout with only 3 events left?

0 favourites
  • 7 posts
From the Asset Store
Forgotten Place - Melodic ambiance, background music, Synth
  • Hello! I'm trying to save the time it took the player to finish a level and display it in another layout. I also only have 3 events left as you can see here.

    I've got the stopwatch set here to show what the timer looks like along with the events.

    This is the layout that I want to save the time on btw (I'm basically trying to make a speedrun version of one of my games because it got +400 plays! Thanks to those that played lol https://www.construct.net/en/free-online-games/ninja-parkour-remade-43352/play).

    I'm not really sure how to store the time and then make some text display the time it took to beat the level. If anyone can help me out, that would be great! :)

  • Replace the local variables with global variables. When the game ends and the variables stop increasing you have the data saved in global variables. The set text action would instead use the global variables and you can display the end time on any layout.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you! This really helped me out a lot! I actually thought that I would have to use local storage! Thanks! :D

  • No problem. Local storage (or save/load game) you would need to use if you were saving the user's high score for the next time they launch the game/app.

  • Now I'm wondering how I'd be able to do that. It would be nice to see a high score. How would you be able to do so?

  • Under tutorials section there is something but essentially you can use system 'save' and 'load' which is just like a save slot, and for example the user's highest ever score would be stored in some global variables.

    Whenever a player finishes a game, with events you could compare the end score variable that you have now with their high score variable and if the new one is faster then update the high score variables, and then 'save' to a save slot. Whenever the user launches the game again you 'load' from the save slot.

    Or you can save the score to local storage, this is like saving and loading single data rather than the full game. The method depends on what is more useful for your type of game.

  • Thanks a lot! You're honestly really helpful! :)

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