randomise


描述

This function sets the seed to a random value. Should you need to keep a consistent value over a number of runs of a game, you should be using random_set_seed(). Please note, that when using the random number functions in GameMaker Studio 2 the initial seed is always the same, as this makes tracing errors and debugging far easier. Should you wish to test with true random, you should call this function at the start of your game. The function will return the new randomised seed value (an unsigned 32bit integer).


语法:

randomise();
// or
randomize();


Returns:

Integer (unsigned 32 bit value)


例如:

randomise();

The above code will randomise the seed.