-
-
Notifications
You must be signed in to change notification settings - Fork 18
random
CryoEagle edited this page Jan 14, 2019
·
11 revisions
Returns a random number from 0 to n
random(n)
Argument | Description |
---|---|
double n |
The upper range from which the random number will be selected |
Returns: double
This function will return a number between a range of 0 and your chosen upper range.
NOTE: This function will return the same value every time the game is run due to the fact that SimplexRpgEngine generates the same initial random seed every time to make debugging code a far easier task. To avoid this behavior, use randomize()
at the start of your game.
double direction = random(360);
This code will return random direction from angle 0° to angle 360°.
Back to number_functions