Flags are merely variables whose values are watched for use in conditionals. A variable named doorLocked
could be considered a flag; if doorLocked is true, the user will not be able to interact with the doorknob to open the door.
If doorLocked is false, not only could the user open it, but other events (such as randomly spawned monsters coming
through the door) could be generated as well.
Flags can track more than simple true/false states. A sidewalk café might need a flag for the weather. If it is sunny and
hot, the variable weather = 0; if it is raining, weather = 1; and if it is overcast, weather = 2. If weather < 2, the umbrellas
need to be put out. The weather constantly changes.