Phaser 3 How to Randomize Objects???

Hello! I am very new to Phaser and I am currently trying to create a math game for kids. The idea is that they will have pieces of trash with random math equations/math answers on them and the kid os supposed to be dragged into a specific garbage can with the answer. My question is how I can create objects in a way where the text will always be randomized, along with the placement of what piece of trash goes into what trashcan. I desperately need some input.

:waving_hand:

Phaser.Utils.Array.Shuffle(array) and Phaser.Math.RND.pick(array) will help.

1 Like

Oh okay. What is the difference between the two?

shuffle() reorders any array in place. pick() selects a random element.

2 Likes