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

Get help using Construct 2

Post » Thu May 29, 2014 11:22 pm

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?
yupenglee.com | @JustOnlyYu
B
14
S
3
Posts: 16
Reputation: 872

Post » Fri May 30, 2014 12:55 am

If the score increments by one each time , you could use modulo >score%10=0 ...do something
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499

Post » Fri May 30, 2014 2:49 am

@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'.
yupenglee.com | @JustOnlyYu
B
14
S
3
Posts: 16
Reputation: 872

Post » Sat May 31, 2014 1:08 am

As long as you found a way that works for you , good luck with your game .
What I know would fill a Book , what I don't know would fill a Library
B
37
S
12
G
29
Posts: 331
Reputation: 16,499


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi and 22 guests