I am making a First-person shooter and I was wondering if anyone knows the code for making people randomly pop put of their hiding places. So like the person comes out of the same place, but at a random time after some others. Anyone know?
first:
I think this question belongs in the Game programming forum…
second:
take a look at the setInterval() functoin, combined with the Math.random() function.
for example:
[AS]
doThis = function () {
trace(“Whatever”);
clearInterval(itv);
};
itv = setInterval(doThis, Math.round(Math.random()*10000));
[/AS]