Fandom

Game Maker

Random()

281pages on
this wiki
Add New Page
Talk0 Share

random(x) returns a random value between 0 and x.

Code Sample Edit

y=random(room_height); // sets the y to a random position within the room

Other ways to generate random numbers Edit

  • irandom(n) - only returns integers
  • irandom_range(n1,n2) - return integer between n1 and n2
  • choose(option1,option2,...) - picks one of the options
  • random_set_seed(seed_value), random_get_seed() - influence the outcome of random(x)

See Also Edit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.