Adding up timed levels

0 favourites
  • 4 posts
From the Asset Store
Unlock Levels, Worlds & skin plus add coins by watching ads
  • Hello, I usually don't ask for help but after 72 hours of searching trying, and failing I have become very stressed. So I am asking for some help please.

    Ok, I have been making a game for the's BUILD & WIN Construct 2 Contest. So far my game has 5 levels, and what I am trying to do is add a simple timer to act as a scoring system.

    After many failed attempts at this I finally got close when I found this thread Restting Local Variables were Kyatric posted this commented capx.

    So what I used from it was I made 2 global variables one named Score this one is a text variable, and the other named TimeLevel this one is a number variable.

    The timer works great, and resets to 0 after each level then adds the levels time to the Score variable. But at the end of the game when you are taken to a score page instead of adding up all the level scores it just lists them in order next to each other like 34, 56, 72, ect.

    So my question is what am I doing wrong? :( How do I make each level score add onto each other to get a total game time to display on the score page?

    Any Help would be greatly appreciated like I said earlier I don't like to ask for help but I really need it.

  • Could you add a 'score_so_far' variable, which you add on to at the end of every level?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you sqiddster for your suggestion but that didn't work for adding each level's time into one total game time. But you did help me figure out a solution, and also gave me another Idea for my game :D

    First the solution in case anyone else is ever searching for how to add up all the levels times into one. What I did was changes my Score variable form text to number. Then I set up my game to add 1 to my Score variable every one second. Just like I did for my timer to my TimeLevel variable. Except with my Score timer I didn't set it to reset to 0 each level. It's basically two timers keeping the same time except one only keeps each levels time while the other keeps total game time. I hope this makes sense anyway it works :D

    And the new Idea you gave me was to maybe use your 'score_so_far' variable to add each levels time to a level select page. So that once a level is completed, and unlocked a player can see his or her level time. Then select that level, and try to get a better time. Of course this idea will need some server side scripting, and a database. I probably wont try this until after the contest.

    But thanks again sqiddster :D

  • have a global variable set to Zero, try after the game.

    Set Value to time value. just make sure you dont reset it.

    only reset the time to be reuesed.

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