Note: some people do tests like
if (bIsActive == true) but I find it redundant. I prefer to write:
if (bIsActive) (but others might disagree).
Basically, you wonder about the difference between a global (or more exactly public class level) variable and the usage of getters and setters. Except you don't have a setter in your question...
Ie. you are supposed to provide both setTruth() and getTruth() (although for boolean returns, there is the more common form isTruth()).
Most articles and books on object oriented programming will advice to use the second form. It is called encapsulation: hiding implementation details behind a public API. That API is a kind of contract, people using your code (including yourself!) is guaranteed that these functions won't change (or if it does, implementers will warn you, and take some other precautions) even if the implementation changes (eg. replacing
return truth; by
return Test() || x >= 0;).
Now, Processing sketches are often small, so the first approach is generally OK. Unless you make a library...
To answer your question, if you use accessors, it should look like:
if( ... ) { setTruth(true); } // conditions for truth
if (isTruth()) { ... } // useThe two functions are quite trivial, I don't give them...