Global Boolean

Discussion and feedback on Construct 2

Post » Sat Oct 13, 2012 7:25 pm

I'm not sure why there isn't a boolean type for global variables, but it could be very useful for disabling specific sheets/actions under certain instances.Helladen2012-10-13 19:25:44
Image
B
20
S
4
Posts: 105
Reputation: 2,315

Post » Sun Oct 14, 2012 1:02 am

It's been on our todo list a while. It was an oversight when we originally implemented global variables - for now a number being 0 or 1 should do.
Scirra Founder
B
359
S
214
G
72
Posts: 22,946
Reputation: 178,478

Post » Sun Oct 14, 2012 2:54 am

Yeah, glad to know it is on the todo list though.
Image
B
20
S
4
Posts: 105
Reputation: 2,315

Post » Thu Dec 20, 2012 11:55 pm

[QUOTE=Ashley] It's been on our todo list a while. It was an oversight when we originally implemented global variables - for now a number being 0 or 1 should do.[/QUOTE]

Is there an easy way to toggle a number between 0 and 1 as though it was a boolean?
B
4
Posts: 7
Reputation: 339

Post » Fri Dec 21, 2012 3:50 am

[QUOTE=narfi] [QUOTE=Ashley] It's been on our todo list a while. It was an oversight when we originally implemented global variables - for now a number being 0 or 1 should do.[/QUOTE]

Is there an easy way to toggle a number between 0 and 1 as though it was a boolean?[/QUOTE]

Sure. Just set Number to abs(Number - 1). It will change a zero to a one, and a one to a zero.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Sun Mar 24, 2013 9:23 pm

I was just about to type this post and found this. +1 for global/local booleans!
B
8
S
1
G
1
Posts: 37
Reputation: 1,326


Return to Construct 2 General

Who is online

Users browsing this forum: Mirlas and 2 guests