min


描述

This function returns the minimum of the input values, of which it can have as many as you require (note that more arguments will mean that the function will be slower to parse). For example min(12, 96, 32, 75) will return 12 as that is the lowest of all the input values.


语法:

min(val1, val2, ... max_val);


参数 描述
val0 ... max_val The values to compare.


Returns:

实数


例如:

x = min(x, room_width);

This will stop the player from exiting the right of the room. This works by constantly setting its x to either itself or the room_width variable, whichever is smaller. If the player exits the right, its x would be larger than room_width, so it'll get set straight back.