Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
CryoEagle edited this page Jan 14, 2019 · 11 revisions

random

Returns a random number from 0 to n

Syntax:

random(n)
Argument Description
double n The upper range from which the random number will be selected

Returns: double

Description:

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.

Example:

double direction = random(360);

This code will return random direction from angle 0° to angle 360°.

Back to number_functions

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /