lundi 20 avril 2015

How do I make a double-randomizer in AS3?

I want to make a randomize function that loops when the character touches an object (grass), and if that number hits 3, per say, out of 4, it goes to another randomizer which selects a value between 1-5. After it selects a number it should stop the randomizing.

Pseudo-code below

If the character is hitting grass
Randomize a number between 1 and 4
  If that number is 3, randomize a number between 1 and 5
  If that number is 1, gotoAndPlay(1, "battle1")
  If that number is 2,....etc
If that number is not a 3, loop the original randomize.




Aucun commentaire:

Enregistrer un commentaire