How can I tell if a number is odd or even with events/code?

Just started using Construct 2? Post your questions here

Post » Sat Mar 28, 2015 1:15 am

Like the title says. I'd like to be able to get a condition to trigger if variable X is an odd number. I seem to remember that there's a way, like if you have the number 73 and do some math magic stuff you get 1 returned while if it's 74 you get zero. I can't remember how though and I don't have the brainpower to figure it out by myself. Any help much appreciated :)
B
42
S
16
G
6
Posts: 544
Reputation: 7,701

Post » Sat Mar 28, 2015 2:05 am

var % 2

Modulus
ImageImageImage
B
72
S
22
G
290
Posts: 3,886
Reputation: 159,513

Post » Sat Mar 28, 2015 2:33 am

Thanks :-D
B
42
S
16
G
6
Posts: 544
Reputation: 7,701


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests