Use builtin shuffle method
This commit is contained in:
parent
99b2462759
commit
52ebd8779d
1 changed files with 1 additions and 2 deletions
|
|
@ -22,8 +22,7 @@ export default class PlayScene extends Phaser.Scene {
|
|||
this.backgroundOrder = []
|
||||
for (let i = 1; i < 10; ++i)
|
||||
this.backgroundOrder.push(i)
|
||||
//shuffle array
|
||||
this.backgroundOrder = this.backgroundOrder.sort(() => 0.5 - Math.random())
|
||||
Phaser.Utils.Array.Shuffle(this.backgroundOrder)
|
||||
}
|
||||
|
||||
preload() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue