Jump to content

Pick random element


Recommended Posts


I'm still getting into phaser and javascript thing, and found this method (LINK) which return random element from array. But have no idea how to use it.

Can I do something like this ?

this.sound.play(Phaser.Math.RandomDataGenerator.Pick(['sfx_0', 'sfx_1', 'sfx_2']));


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...