How do I initiate action every 100th of (variable)

Get help using Construct 2

Post » Thu Jan 26, 2017 10:12 am

I want to give the player a prize for every 100th in their score, so when the score hits 100, 200, 300, 400, so on.

How can I tell the engine to do that without having to do;

'If (variable) equals 100 then>
If variable equals 200 then>

I hope you understand what I mean.
B
30
S
12
G
1
Posts: 167
Reputation: 3,038

Post » Thu Jan 26, 2017 10:18 am

Have a separate variable that counts up with the score. When it hits 100, you win the prize, then have it reset to 0.
B
52
S
21
G
93
Posts: 2,419
Reputation: 55,026

Post » Thu Jan 26, 2017 3:42 pm

Plinkie's sol'n is good.
Another way would be to use % or modulo.

Using variable compare:

If Score > 0 &&
If Score % 100 = 0 | [award your prize.]
"The intent is to provide subscribers with a sense of pride and accomplishment for unlocking different features...."
B
42
S
18
G
32
Posts: 818
Reputation: 20,779


Return to How do I....?

Who is online

Users browsing this forum: Elliott and 4 guests