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
25
S
10
G
1
Posts: 154
Reputation: 2,687

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
47
S
17
G
82
Posts: 2,232
Reputation: 48,611

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.]
Image Image Image
B
32
S
12
G
27
Posts: 761
Reputation: 17,244


Return to How do I....?

Who is online

Users browsing this forum: UberLou and 10 guests