Skip to content

Commit 9a755f5

Browse files
author
dandrei
committed
Revert player navigation between 1st branch and last
1 parent c90eb07 commit 9a755f5

1 file changed

Lines changed: 7 additions & 11 deletions

File tree

src/actors/player/index.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,12 @@ class Player extends Phaser.Group {
7070

7171
if (!this.children[this.currentPosition - 1]) {
7272

73-
this.currentPosition = this.children.length - 1
74-
75-
} else {
76-
77-
this.currentPosition--
73+
return
7874

7975
}
8076

77+
this.currentPosition--
78+
8179
this.move()
8280

8381
}
@@ -86,14 +84,12 @@ class Player extends Phaser.Group {
8684

8785
if (!this.children[this.currentPosition + 1]) {
8886

89-
this.currentPosition = 0
90-
91-
} else {
92-
93-
this.currentPosition++
87+
return
9488

9589
}
9690

91+
this.currentPosition++
92+
9793
this.move()
9894

9995
}
@@ -105,7 +101,7 @@ class Player extends Phaser.Group {
105101
if (isUpdateAvailable) {
106102

107103
this.children[this.currentPosition].disarm()
108-
104+
109105
}
110106

111107
}

0 commit comments

Comments
 (0)