Incremental time change based on game level.

seveksevek Member, PRO Posts: 30

Hi.

So, I am pretty new at this and need some help from experts!

There are three variables: Time, Game Level, Progress bar.

At Time = 0, Game Level is 1 (and progress bar is at zero).

At time = 20, game level is 2 (and progress bar has reached its 100% and returned back to zero).

 <-- From Level 1 to 2, it took 20 seconds. 

At time = 45, game level is now 3 (with progress bar back to 0%, or reset).

<--- From Level 2 to 3, it took 25 seconds

At time = 75, game level is not 4 (with progress bar back to 0% once again).

<-- From Level 3 to 4, it took 30 seconds.

Every increase in game level, the amount of time it takes to reach the next level increases by 5 second and the progress bar shows that increase (As it will take 5 second more to reach 100%).

I was able to increase the "game level" text by +1, but I am having trouble making the incremental time increase by 5 second for following levels.

Any suggestions??

Thanks!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Each time the level increases, increase an integer attribute called game.timeToNextLevel by 5. Use that in your rule that determines whether the goal has been met.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    Time = (level*5)+15

  • seveksevek Member, PRO Posts: 30

    Thank you guys for the comments.

    So, This is what I have and here is what's not working.

       Timer:
           Every "15+(game.level*5)" second,
    
       Change Attribute"
           "game.level" to "game.level+1"
    
       Display Text:
          display:  "Level:"..game.level
    

    From this, the game level text does get updated.
    However, the initial "Game.level" in Timer does not get updated from the "change attribute" code.

    Thus, the level gets increased every 20 seconds regardless of the current level.

    What should I do?

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    The Timer behavior does not update it's duration when an attribute is used. So if game.level starts at 1, that timer will run every 20 seconds (15+1*5) no matter what happens to the value of game.level later. If you are using a timer, try my custom interval timer: http://forums.gamesalad.com/discussion/comment/464547/#Comment_464547.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • seveksevek Member, PRO Posts: 30

    Thanks Tatiang!

    I will give it a try and let you know what I have.

    Thanks!

Sign In or Register to comment.