***Solved*** Count up timer triggers event.

0 favourites
  • 3 posts
From the Asset Store
Tabata timer
$9.99 USD
Template for Tabata timer, fully documented in comments and video
  • Hello great and powerful How do I forum. I have a question in my game at the end of a level I take the score and display it using a timer function to scroll it from zero to say a thousand depending on what you scored. As it's scrolling up the numbers I'd like to have it trigger an event. In other words when it hits the number 100 a bonus star is displayed. Any ideas?

    Thanks in advance.

  • Hello dthomasdigital;

    There are a couple of ways to do this and below is how I would have done it.

    Lets say you are showing the score in a textbox. Instead of directly manipulating the textbox objects text propoerty, first I advice to create a global variable named "ShowScore" and tie the timer function to it as you have already done with your current score display system.

    Then change textbox objects text property to ShowScore every tick

    Then do

    run once while true

    score >= scorelimit1

    starsprite visible

    you can add additional score limits too.

    But if by scrolling you mean you have a sprite that has all the possible scores displayed on it and you are scrolling the sprite slowly, you will have to find the distances and make some mathematical function to calculate which score it's showing based on how much it has moved from it's starting position. For that kind of thing, community would need a proejct file to be able to help I think.

    Hope this helps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your solution worked perfectly, thank you very much.

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