I need help again

How do I make a random chooser for 1-12. I tried using a list but that didn't help so I just made really long and confusing lines of code.

@desertjetdoctor,

Depends on your purpose, snap has a builtin block called pick random _ to _, you can input 1 for first blank and 12 for 2nd blank..., do you need to do something after? Do you need to choose repeatedly? If so, you can apply repeat as well...

Good luck...

I am making it target individual sprites, plus I don't want it to change the target immediately, and I have it move two different ways. So when it chooses it moves based on what it chooses.

pick random sprite on the stage
Try the above...it will pick a random sprite from your stage... basically all the available sprites...if the number of sprites changes, you can simply calculate the length using the length of block, then change 12 to the length of number of sprites...

Hope that helps.

Then set a variable to the random number, then check which sprite it is based on the variable.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.