Is there a way to find the "every 10th number" in a score?

0 favourites
  • 4 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • I have a basic scoring system (txt_score | Set text to score). At every 10th point (10,20,30,40...and so on), something will trigger. Is there a way to figure that out?

  • If the score increments by one each time , you could use modulo >score%10=0 something

  • granpa I don't really understand modulos. However, I've found another way that answered my question, but takes a few more steps:

    Alongside my 'score' global variable, I added another global variable named 'score_10th'. Each incremental point earned through the game will be added to both variables. Once both variables reach 10, there's a trigger that resets the 'score_10th' variable to 0 and creates an object; the 'score' continues to accumulate points unaffected. When the 'score' reaches 20, the 'score_10th' reaches 10, which will reset to 0 again. So, the 'score' will continue to accumulate separately from the 'score_10th'.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As long as you found a way that works for you , good luck with your game .

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