What is Global Number = 0 or 1?

Get help using Construct 2

Post » Thu Mar 05, 2015 4:34 pm

A question regarding the Global Variable. What is actually the Global number xxxxx = 0 or 1 means in our game? Example:
Global number pause = 0
Global number record = 0
Global number avatar = 1
Global number sound = 1

Why we need to use 0 or 1?
B
14
S
5
G
4
Posts: 36
Reputation: 3,074

Post » Thu Mar 05, 2015 4:36 pm

my guess would be that they means true or false, there are no global booleans in C2 (oversight IIRC) so people use generally 0 and 1 to represent it. for exemple pause = 0 could mean the game is not paused, and pause= 1 means the game is paused.

however, 1 or 0 are just a choice, it could be -1 and 1, or 0 and 2, that would work too in theory.

just my thinking of it.

also in conditionnal expressions, 0 means false and every other number seems to mean true, so there is possibly that too.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
43
S
18
G
18
Posts: 2,106
Reputation: 16,426


Return to How do I....?

Who is online

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