From 383e035b8afc9839786489f55d5beec64413c504 Mon Sep 17 00:00:00 2001 From: Samantha Date: Mon, 9 Sep 2024 20:12:59 -0400 Subject: [PATCH] Fixed player layer ordering --- create1.js | 2 ++ create2.js | 3 +++ create3.js | 5 +++++ create4.js | 5 +++++ create5.js | 6 +++++- createDemo.js | 5 +++++ 6 files changed, 25 insertions(+), 1 deletion(-) diff --git a/create1.js b/create1.js index 7253955..a8a9658 100644 --- a/create1.js +++ b/create1.js @@ -49,6 +49,8 @@ function create1() { } } } + player.setDepth(1); + jewel.setDepth(2); const LEVEL_TWO_BOTTOM = 2 * CENTER_VERTICAL - 100; diff --git a/create2.js b/create2.js index 6bdc226..b1977a3 100644 --- a/create2.js +++ b/create2.js @@ -50,6 +50,9 @@ function create2() { } } } + player.setDepth(1); + guards.setDepth(2); + jewel.setDepth(2); const LEVEL_TWO_BOTTOM = 2 * CENTER_VERTICAL - 100; diff --git a/create3.js b/create3.js index 514d88e..cae6018 100644 --- a/create3.js +++ b/create3.js @@ -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(); diff --git a/create4.js b/create4.js index 8282b9e..2b29490 100644 --- a/create4.js +++ b/create4.js @@ -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(); diff --git a/create5.js b/create5.js index 1f8ee7e..bf12d54 100644 --- a/create5.js +++ b/create5.js @@ -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(); diff --git a/createDemo.js b/createDemo.js index 986333e..56bc492 100644 --- a/createDemo.js +++ b/createDemo.js @@ -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);