True

In Game Maker, true is a real constant equivalent to the value 1. However, generally, you would treat it as a. This means that any variable assigned that value should only have one of two values: true or.

True is most commonly used in situations where something happens if certain criteria are fulfilled. A variable that stores this information is called a flag. For example:

if (switch==true) { instance_create(obj_trap1); }

However, it is recommended to write this statement as:

if (switch) { instance_create(obj_trap1); }

This way is more clear and concise.

Datatype
All values in Game Maker are stored as real values and datatypes such as boolean do not exist in any definable way (real values are actually of the double datatype, but you can not change this). So even when a boolean is required you actually provide a real value. Therefore it is important to note that in Game Maker a value less than 0.5 is evaluated as false and a value greater than or equal to 0.5 is evaluated as true in statements that require a boolean value such as the statement. However, true does not equal 0.5 nor any other value than 1, and false does not equal anything other than 0.

Examples
In Game Maker, all of the following statements are equivalent:

if (true) if (1) if (1.0) if (0.5) if (10.1)