Random (int max)
Returns a random number between 0 and MAX. This could be useful to do
various effects in your game.
NOTE: The range returned is inclusive - ie. if you do Random(3); then it
can return 0, 1, 2 or 3.
Example:
int ran=Random(2);
if (ran==0) cEgo.ChangeRoom(1);
else if (ran==1) cEgo.ChangeRoom(2);
else cEgo.ChangeRoom(3);
will change the current room to room 1,2 or 3 depending on a random result.
|