YoYo Games Wiki

False

From YoYoGames Wiki

In Game Maker, false is a boolean. This means that any variable assigned that value can only have 2 values, true or false.

False is most commonly used in situations where something happens if certain criteria are not fulfilled. For example:

if (switch==false)
{
 with (obj_trap) instance_destroy();
}


In Game Maker, false has a value of 0. It is a constant.

if (instance_exists(obj_player)==false)

Is the same as:

if (instance_exists(obj_player)==0)

However it is very recommended to write just:

if (not instance_exists(obj_player))

because this way is the most clear.


Please note that boolean values in Game Maker are stored as real values. So even when a boolean is required you can actually provide any real value. In such a case and value <0.5 is equivalent to false and any value >= 0.5 is equivalent to true.