08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

max(val1,val2,val3,...) Returns the maximum of the values. The<br />

function can have up to 16 arguments. They must either be all real or all<br />

strings.<br />

mean(val1,val2,val3,...) Returns the average of the values. The<br />

function can have up to 16 arguments. They must all be real values.<br />

median(val1,val2,val3,...) Returns the median of the values, that is,<br />

the middle value. (When the number of arguments is even, the smaller of the<br />

two middle values is returned.) The function can have up to 16 arguments.<br />

They must all be real values.<br />

point_distance(x1,y1,x2,y2) Returns the distance between point<br />

(x1,y1) and point (x2,y2).<br />

point_direction(x1,y1,x2,y2) Returns the direction from point (x1,y1)<br />

toward point (x2,y2) in degrees.<br />

lengthdir_x(len,dir) Returns the horizontal x-component of the vector<br />

determined by the indicated length and direction.<br />

lengthdir_y(len,dir) Returns the vertical y-component of the vector<br />

determined by the indicated length and direction.<br />

is_real(x) Returns whether x is a real value (as opposed to a string).<br />

is_string(x) Returns whether x is a string (as opposed to a real value).<br />

String handling functions<br />

The following functions deal <strong>with</strong> characters and string.<br />

chr(val) Returns a string containing the character <strong>with</strong> asci code val.<br />

ord(str) Returns the asci code of the first character in str.<br />

real(str) Turns str into a real number. str can contain a minus sign, a<br />

decimal dot and even an exponential part.<br />

string(val) Turns the real value into a string using a standard format (no<br />

decimal places when it is an integer, and two decimal places otherwise).<br />

string_format(val,tot,dec) Turns val into a string using your own<br />

format: tot indicates the total number of places and dec indicates the number<br />

of decimal places.<br />

string_length(str) Returns the number of characters in the string.<br />

string_pos(substr,str) Returns the position of substr in str (0=no<br />

occurrence).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!