kvazmatik Posted May 8, 2018 Share Posted May 8, 2018 Hi, 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 More sharing options...
samme Posted May 8, 2018 Share Posted May 8, 2018 I think it's in Phaser.Math.RND, as in Phaser.Math.RND.pick(/* ... */) Docs are maybe not clear on that. kvazmatik 1 Link to comment Share on other sites More sharing options...
kvazmatik Posted May 8, 2018 Author Share Posted May 8, 2018 Yep it's working. Many thanks. Docs need some work indeed. Link to comment Share on other sites More sharing options...
Recommended Posts