dimanche 4 novembre 2018

How to randomly choose an item from a list in Javascript

I'm creating a game in buildbox, and i'm trying to create a script that is written in javascript(I am not a javascript coder) to choose randomly from a range of colors, for example:

color_list = [color1,color2,color3]

So that it in this list it picks color2 randomly taking into account color 2 is: (255,0,0) in RGB

Thanks for the help!




Aucun commentaire:

Enregistrer un commentaire