Instance variable trigger once

Get help using Construct 2

Post » Sat Apr 02, 2016 5:31 pm

Hey everyone, I'm stumped by something that's got an insanely easy answer, I just can't seem to find anyone answering it.
Basically I have four boxes, when you click each one you add 1 to an instance variable, meaning you need to click all four to get to the next event. However, if you click the same box four times, it gets the same result, how do I make it so that a box will only add 1 and after that will not contribute any more to the instance variable? Thought the trigger once while true would help but I guess not.

Sorry for such an amateur question :shock:

Thanks!
B
10
S
2
G
1
Posts: 36
Reputation: 707

Post » Sat Apr 02, 2016 5:39 pm

I would give each box a Boolean, if it is false, when clicked, add 1 to the variable you're talking about and set the Boolean to true. If it is true, then subtract 1 from the variable (assuming it is not 0) and set the Boolean to false.
B
59
S
35
G
23
Posts: 341
Reputation: 17,032


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 18 guests