1
0
forked from 0ad/0ad
0ad/binaries/data/mods/public/simulation/helpers/Random.js
Ykkrosh e19146cf25 # Added AI for chickens.
Add scripted HFSM system.
Add very basic animal AI.
Support script-only message types.
Add shift+D hotkey to toggle dev command panel.

This was SVN commit r7763.
2010-07-18 15:19:49 +00:00

10 lines
209 B
JavaScript

/**
* Returns a random integer from min (inclusive) to max (exclusive)
*/
function RandomInt(min, max)
{
return Math.floor(min + Math.random() * (max-min))
}
Engine.RegisterGlobal("RandomInt", RandomInt);