FYI, a flag IS a variable. It just means a variable whose purpose is to "flag" that something is true or false. Generally a flag is a boolean (bool) variable, although it could be a bit value compared to a bit field. For example, you could use:
#define CHAR_FLAG_DOUBLE_JUMP_USED 0x00000040
Then a variable such as "charFlags" which is used for several flags. Each bit of the variable represents one flag. So, to check if double jump should work or not, you'd do this:
if( charFlag & CHAR_FLAG_DOUBLE_JUMP_USED )
{ // Don't allow double jump
}
This uses the bitwise & operator.
You set and clear the flags with "charFlag |= CHAR_FLAG_DOUBLE_JUMP_USED" and "charFlag &= ~CHAR_FLAG_DOUBLE_JUMP_USED."
Its just a way to store multiple flags in one variable, and is particularly useful when coding for hardware that only lets you allocate memory in certain sized blocks (in other words, even if you declare a variable as a boolean, it still allocates a full 32 bits of memory, so a bunch of booleans is a bunch of wasted memory since you are only using 1 bit of each one, thus you make a single u32 and access its bits individually as boolean flags. This actually comes up quite a bit on console and handheld game hardware, but not on PC programming).
Its not often used these days because memory isn't that tight, except in cases where you have a LOT of a certain type of object (say, a particle) that all need to store multiple booleans and thus the wasted memory adds up quickly. It is also useful for saved game data to save room on the memory card. For example, in an old SNES RPG every chest you open is a single bit to flag if you have already opened it or not, to keep the save data nice and compact.
In any case, you are right that they probably didn't use a flag but used a counter variable, since some characters have multiple mid-air jumps that would need to be tracked. Not that that means anything to my conclusions about how getting an extra jump after the down+B would most likely require exta, intentionally placed code to be added just to have that happen.