Skip to content

Commit

Permalink
Fixed player layer ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
SamanthaSmith04 committed Sep 10, 2024
1 parent 5d95de6 commit 383e035
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions create1.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function create1() {
}
}
}
player.setDepth(1);
jewel.setDepth(2);

const LEVEL_TWO_BOTTOM = 2 * CENTER_VERTICAL - 100;

Expand Down
3 changes: 3 additions & 0 deletions create2.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ function create2() {
}
}
}
player.setDepth(1);
guards.setDepth(2);
jewel.setDepth(2);

const LEVEL_TWO_BOTTOM = 2 * CENTER_VERTICAL - 100;

Expand Down
5 changes: 5 additions & 0 deletions create3.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ function create3() {
}
}
}
player.setDepth(1);
for (i = 0; i < guards.length; i++){
guards[i].setDepth(2);
}
jewel.setDepth(2);

// Input Events
cursors = this.input.keyboard.createCursorKeys();
Expand Down
5 changes: 5 additions & 0 deletions create4.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ function create4() {
}
}
}
player.setDepth(1);
for (i = 0; i < guards.length; i++){
guards[i].setDepth(2);
}
jewel.setDepth(2);

// Input Events
cursors = this.input.keyboard.createCursorKeys();
Expand Down
6 changes: 5 additions & 1 deletion create5.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ function create5() {
}
}
}

player.setDepth(1);
for (i = 0; i < guards.length; i++){
guards[i].setDepth(2);
}
jewel.setDepth(2);
// Input Events
cursors = this.input.keyboard.createCursorKeys();

Expand Down
5 changes: 5 additions & 0 deletions createDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ function createDemo() {
}
}
}
player.setDepth(1);
for (i = 0; i < guards.length; i++){
guards[i].setDepth(2);
}
jewel.setDepth(2);

avoidGuard = this.physics.add.staticGroup();
avoidGuard.create(400, CENTER_VERTICAL + 175, "AvoidGuards").setScale(1);
Expand Down

0 comments on commit 383e035

Please sign in to comment.