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 = []
|
this.backgroundOrder = []
|
||||||
for (let i = 1; i < 10; ++i)
|
for (let i = 1; i < 10; ++i)
|
||||||
this.backgroundOrder.push(i)
|
this.backgroundOrder.push(i)
|
||||||
//shuffle array
|
Phaser.Utils.Array.Shuffle(this.backgroundOrder)
|
||||||
this.backgroundOrder = this.backgroundOrder.sort(() => 0.5 - Math.random())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
preload() {
|
preload() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue