Hi all,
I'm making the levels, a global variable is added by one unlocks each level.
<img src="http://i.imgur.com/b18x3Yw.png" border="0" />
I'm wondering how to compress these events into one, is possible?
You can use the logical OR operator.
world_GoodLevels = 1 | world_GoodLevels = 2 | world_GoodLevels = 3 | world_GoodLevels = 4 | world_GoodLevels = 5 | world_GoodLevels = 6
=
1
Develop games in your browser. Powerful, performant & highly capable.
You can use the logical OR operator. world_GoodLevels = 1 | world_GoodLevels = 2 | world_GoodLevels = 3 | world_GoodLevels = 4 | world_GoodLevels = 5 | world_GoodLevels = 6 = 1
thehen
It seems working
<img src="http://i.imgur.com/VZYn7ws.png" border="0">
It makes me wonder it looks illogical to me when these OR operators are equal to 1 or was it luck?
It's saying that if any of those OR statements are true, then it returns true. 1 is true, 0 is false. Hence the comparison.
thehen interesing, thanks!
Interesting thx!
Very interesting! All the little things that get overlooked seem to be the most powerful ;) Thanks for sharing!
You could also use >=1 AND <=6 in this case.