User prompt
Increase speed of walls for each level
User prompt
Make the wall2 small and increase the respawning of it in level 2.
User prompt
Add game over to the game if player touch any wall in any level trigger game over.
User prompt
If player touch gate in level2 teleport it to level3 so on
User prompt
Add collision to wall2-10
User prompt
Add collision to gate in level2
User prompt
Add collision to gate in each level
User prompt
Add player to other levels
User prompt
Increase speed of the player
User prompt
Make it move when click not teleport to the point
User prompt
Increase speed of player
User prompt
Don't move player to level 2 teleport it to level 2 when touch the gate in level 1
User prompt
If player touch the gate in level1 go to level2 so on till level10
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'gate.x = Math.random() * (2048 - gate.width) + gate.width / 2;' Line Number: 648
User prompt
Please fix the bug: 'TypeError: currentLevel.getChildByName is not a function' in or related to this line: 'var gate = currentLevel.getChildByName('gate'); // Retrieve the gate by name' Line Number: 647
User prompt
Please fix the bug: 'TypeError: Cannot read properties of undefined (reading 'width')' in or related to this line: 'gate.x = Math.random() * (2048 - gate.width) + gate.width / 2;' Line Number: 648
User prompt
Please fix the bug: 'ReferenceError: gate is not defined' in or related to this line: 'gate.x = Math.random() * (2048 - gate.width) + gate.width / 2;' Line Number: 646
User prompt
If player touch the gate go to the next level
User prompt
Please fix the bug: 'TypeError: game.reset is not a function' in or related to this line: 'game.reset();' Line Number: 105
User prompt
Add level2-10
User prompt
Make level10 last level
User prompt
Please fix the bug: 'TypeError: LK.showNextLevel is not a function' in or related to this line: 'LK.showNextLevel();' Line Number: 101
User prompt
Make random shapes of wall1
User prompt
Increase walls in level1
User prompt
Remove 3 lines of the respawning wall1 from top and bottom of the screen.
/**** * Classes ****/ var Level1 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background1', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall1a = self.attachAsset('wall1', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall1b = self.attachAsset('wall1', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var wall1c = self.attachAsset('wall1', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall1d = self.attachAsset('wall1', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 // half of the gate height (250/2) }); self.update = function () { wall1a.x -= 12; wall1b.x += 12; wall1c.x -= 12; wall1d.x += 12; if (wall1a.x < -wall1a.width / 2) { wall1a.x = 2048 + wall1a.width / 2; wall1a.y = Math.random() * (gate.y - player.y - wall1a.height) + player.y + wall1a.height / 2; // Randomly set the y-coordinate for wall1a between the gate and the player } if (wall1b.x > 2048 + wall1b.width / 2) { wall1b.x = -wall1b.width / 2; wall1b.y = Math.random() * (gate.y - player.y - wall1b.height) + player.y + wall1b.height / 2; // Randomly set the y-coordinate for wall1b between the gate and the player } if (wall1c.x < -wall1c.width / 2) { wall1c.x = 2048 + wall1c.width / 2; wall1c.y = Math.random() * (2732 - wall1c.height) + wall1c.height / 2; // Randomly set the y-coordinate for wall1c within screen boundaries } if (wall1d.x > 2048 + wall1d.width / 2) { wall1d.x = -wall1d.width / 2; wall1d.y = Math.random() * (2732 - wall1d.height) + wall1d.height / 2; // Randomly set the y-coordinate for wall1d within screen boundaries } // Rotate the gate gate.rotation -= 0.01; // Rotate 360° to the left // Check for collision between player and walls if (player.intersects(wall1a) || player.intersects(wall1b) || player.intersects(wall1c) || player.intersects(wall1d)) { // Flash screen red for 1 second (1000ms) to show collision. LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } // Check for collision between player and gate if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level10 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background10', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall10a = self.attachAsset('wall10', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall10b = self.attachAsset('wall10', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall10a.x -= 28; wall10b.x += 28; if (wall10a.x < -wall10a.width / 2) { wall10a.x = 2048 + wall10a.width / 2; wall10a.y = Math.random() * (gate.y - player.y - wall10a.height) + player.y + wall10a.height / 2; } if (wall10b.x > 2048 + wall10b.width / 2) { wall10b.x = -wall10b.width / 2; wall10b.y = Math.random() * (gate.y - player.y - wall10b.height) + player.y + wall10b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall10a) || player.intersects(wall10b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level2 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background2', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall2a = self.attachAsset('wall2', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall2b = self.attachAsset('wall2', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall2a.x -= 18; wall2b.x += 18; if (wall2a.x < -wall2a.width / 2) { wall2a.x = 2048 + wall2a.width / 2; wall2a.y = Math.random() * (gate.y - player.y - wall2a.height) + player.y + wall2a.height / 2; } if (wall2b.x > 2048 + wall2b.width / 2) { wall2b.x = -wall2b.width / 2; wall2b.y = Math.random() * (gate.y - player.y - wall2b.height) + player.y + wall2b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall2a) || player.intersects(wall2b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } // Check for collision between player and gate if (player.intersects(gate)) { game.level = 3; // Set the next level to Level 3 moveToNextLevel(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level3 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background3', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall3a = self.attachAsset('wall3', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall3b = self.attachAsset('wall3', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall3a.x -= 14; wall3b.x += 14; if (wall3a.x < -wall3a.width / 2) { wall3a.x = 2048 + wall3a.width / 2; wall3a.y = Math.random() * (gate.y - player.y - wall3a.height) + player.y + wall3a.height / 2; } if (wall3b.x > 2048 + wall3b.width / 2) { wall3b.x = -wall3b.width / 2; wall3b.y = Math.random() * (gate.y - player.y - wall3b.height) + player.y + wall3b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall3a) || player.intersects(wall3b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level4 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background4', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall4a = self.attachAsset('wall4', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall4b = self.attachAsset('wall4', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall4a.x -= 16; wall4b.x += 16; if (wall4a.x < -wall4a.width / 2) { wall4a.x = 2048 + wall4a.width / 2; wall4a.y = Math.random() * (gate.y - player.y - wall4a.height) + player.y + wall4a.height / 2; } if (wall4b.x > 2048 + wall4b.width / 2) { wall4b.x = -wall4b.width / 2; wall4b.y = Math.random() * (gate.y - player.y - wall4b.height) + player.y + wall4b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall4a) || player.intersects(wall4b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level5 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background5', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall5a = self.attachAsset('wall5', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall5b = self.attachAsset('wall5', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall5a.x -= 18; wall5b.x += 18; if (wall5a.x < -wall5a.width / 2) { wall5a.x = 2048 + wall5a.width / 2; wall5a.y = Math.random() * (gate.y - player.y - wall5a.height) + player.y + wall5a.height / 2; } if (wall5b.x > 2048 + wall5b.width / 2) { wall5b.x = -wall5b.width / 2; wall5b.y = Math.random() * (gate.y - player.y - wall5b.height) + player.y + wall5b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall5a) || player.intersects(wall5b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level6 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background6', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall6a = self.attachAsset('wall6', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall6b = self.attachAsset('wall6', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall6a.x -= 20; wall6b.x += 20; if (wall6a.x < -wall6a.width / 2) { wall6a.x = 2048 + wall6a.width / 2; wall6a.y = Math.random() * (gate.y - player.y - wall6a.height) + player.y + wall6a.height / 2; } if (wall6b.x > 2048 + wall6b.width / 2) { wall6b.x = -wall6b.width / 2; wall6b.y = Math.random() * (gate.y - player.y - wall6b.height) + player.y + wall6b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall6a) || player.intersects(wall6b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level7 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background7', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall7a = self.attachAsset('wall7', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall7b = self.attachAsset('wall7', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall7a.x -= 22; wall7b.x += 22; if (wall7a.x < -wall7a.width / 2) { wall7a.x = 2048 + wall7a.width / 2; wall7a.y = Math.random() * (gate.y - player.y - wall7a.height) + player.y + wall7a.height / 2; } if (wall7b.x > 2048 + wall7b.width / 2) { wall7b.x = -wall7b.width / 2; wall7b.y = Math.random() * (gate.y - player.y - wall7b.height) + player.y + wall7b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall7a) || player.intersects(wall7b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level8 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background8', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall8a = self.attachAsset('wall8', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall8b = self.attachAsset('wall8', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall8a.x -= 24; wall8b.x += 24; if (wall8a.x < -wall8a.width / 2) { wall8a.x = 2048 + wall8a.width / 2; wall8a.y = Math.random() * (gate.y - player.y - wall8a.height) + player.y + wall8a.height / 2; } if (wall8b.x > 2048 + wall8b.width / 2) { wall8b.x = -wall8b.width / 2; wall8b.y = Math.random() * (gate.y - player.y - wall8b.height) + player.y + wall8b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall8a) || player.intersects(wall8b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Level9 = Container.expand(function () { var self = Container.call(this); var background = self.attachAsset('Background9', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 2048 / 800, scaleY: 2732 / 800 }); var wall9a = self.attachAsset('wall9', { anchorX: 0.5, anchorY: 0.5, x: 2048, y: 1366 }); var wall9b = self.attachAsset('wall9', { anchorX: 0.5, anchorY: 0.5, x: 0, y: 1366 }); var gate = self.attachAsset('Gate', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 125 }); self.update = function () { wall9a.x -= 26; wall9b.x += 26; if (wall9a.x < -wall9a.width / 2) { wall9a.x = 2048 + wall9a.width / 2; wall9a.y = Math.random() * (gate.y - player.y - wall9a.height) + player.y + wall9a.height / 2; } if (wall9b.x > 2048 + wall9b.width / 2) { wall9b.x = -wall9b.width / 2; wall9b.y = Math.random() * (gate.y - player.y - wall9b.height) + player.y + wall9b.height / 2; } gate.rotation -= 0.01; if (player.intersects(wall9a) || player.intersects(wall9b)) { LK.effects.flashScreen(0xff0000, 1000); // Trigger game over LK.showGameOver(); } if (player.intersects(gate)) { moveToNextLevel(); } }; }); var Player = Container.expand(function () { var self = Container.call(this); var player = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5, x: 1024 }); player.y = 2732 - player.height / 2; game.down = function (x, y, obj) { var targetX = x; var targetY = y; var speed = 10; game.update = function () { var dx = targetX - player.x; var dy = targetY - player.y; var distance = Math.sqrt(dx * dx + dy * dy); if (distance > speed) { player.x += dx / distance * speed; player.y += dy / distance * speed; } }; game.up = function (x, y, obj) { player.x = player.x; player.y = player.y; }; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ function moveToNextLevel() { if (game.level < 10) { game.level += 1; levelText.setText('Level ' + game.level); player.x = 1024; // Center player horizontally player.y = 2732 - player.height / 2; // Position player at the bottom // Load the next level loadLevel(game.level); } else { LK.showGameOver(); } } function loadLevel(level) { // Remove the current level game.removeChildAt(0); // Add the new level based on the current level number switch (level) { case 1: game.addChild(new Level1()); game.addChild(new Player()); // Add player to level 1 break; case 2: game.addChild(new Level2()); game.addChild(new Player()); // Add player to level 2 break; case 3: game.addChild(new Level3()); game.addChild(new Player()); // Add player to level 3 break; case 4: game.addChild(new Level4()); game.addChild(new Player()); // Add player to level 4 break; case 5: game.addChild(new Level5()); game.addChild(new Player()); // Add player to level 5 break; case 6: game.addChild(new Level6()); game.addChild(new Player()); // Add player to level 6 break; case 7: game.addChild(new Level7()); game.addChild(new Player()); // Add player to level 7 break; case 8: game.addChild(new Level8()); game.addChild(new Player()); // Add player to level 8 break; case 9: game.addChild(new Level9()); game.addChild(new Player()); // Add player to level 9 break; case 10: game.addChild(new Level10()); game.addChild(new Player()); // Add player to level 10 break; } } function resetGame() { // Reset the game state to the initial conditions game.level = 1; levelText.setText('Level ' + game.level); player.x = 1024; player.y = 2732 - player.height / 2; // Additional reset logic can be added here } game.level = 1; var level1 = game.addChild(new Level1()); var player = game.addChild(new Player()); // Create level text var levelText = new Text2('Level 1', { size: 100, // Increase the size of the text fill: 0xFFA500 // Orange color }); // Position the level text at the top right corner levelText.anchor.set(1, 0); // Sets anchor to the right of the top edge of the text. LK.gui.topRight.addChild(levelText);
===================================================================
--- original.js
+++ change.js
@@ -41,20 +41,20 @@
x: 1024,
y: 125 // half of the gate height (250/2)
});
self.update = function () {
- wall1a.x -= 10;
- wall1b.x += 10;
+ wall1a.x -= 12;
+ wall1b.x += 12;
+ wall1c.x -= 12;
+ wall1d.x += 12;
if (wall1a.x < -wall1a.width / 2) {
wall1a.x = 2048 + wall1a.width / 2;
wall1a.y = Math.random() * (gate.y - player.y - wall1a.height) + player.y + wall1a.height / 2; // Randomly set the y-coordinate for wall1a between the gate and the player
}
if (wall1b.x > 2048 + wall1b.width / 2) {
wall1b.x = -wall1b.width / 2;
wall1b.y = Math.random() * (gate.y - player.y - wall1b.height) + player.y + wall1b.height / 2; // Randomly set the y-coordinate for wall1b between the gate and the player
}
- wall1c.x -= 10;
- wall1d.x += 10;
if (wall1c.x < -wall1c.width / 2) {
wall1c.x = 2048 + wall1c.width / 2;
wall1c.y = Math.random() * (2732 - wall1c.height) + wall1c.height / 2; // Randomly set the y-coordinate for wall1c within screen boundaries
}
@@ -105,10 +105,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall10a.x -= 10;
- wall10b.x += 10;
+ wall10a.x -= 28;
+ wall10b.x += 28;
if (wall10a.x < -wall10a.width / 2) {
wall10a.x = 2048 + wall10a.width / 2;
wall10a.y = Math.random() * (gate.y - player.y - wall10a.height) + player.y + wall10a.height / 2;
}
@@ -155,10 +155,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall2a.x -= 15;
- wall2b.x += 15;
+ wall2a.x -= 18;
+ wall2b.x += 18;
if (wall2a.x < -wall2a.width / 2) {
wall2a.x = 2048 + wall2a.width / 2;
wall2a.y = Math.random() * (gate.y - player.y - wall2a.height) + player.y + wall2a.height / 2;
}
@@ -210,10 +210,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall3a.x -= 10;
- wall3b.x += 10;
+ wall3a.x -= 14;
+ wall3b.x += 14;
if (wall3a.x < -wall3a.width / 2) {
wall3a.x = 2048 + wall3a.width / 2;
wall3a.y = Math.random() * (gate.y - player.y - wall3a.height) + player.y + wall3a.height / 2;
}
@@ -260,10 +260,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall4a.x -= 10;
- wall4b.x += 10;
+ wall4a.x -= 16;
+ wall4b.x += 16;
if (wall4a.x < -wall4a.width / 2) {
wall4a.x = 2048 + wall4a.width / 2;
wall4a.y = Math.random() * (gate.y - player.y - wall4a.height) + player.y + wall4a.height / 2;
}
@@ -310,10 +310,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall5a.x -= 10;
- wall5b.x += 10;
+ wall5a.x -= 18;
+ wall5b.x += 18;
if (wall5a.x < -wall5a.width / 2) {
wall5a.x = 2048 + wall5a.width / 2;
wall5a.y = Math.random() * (gate.y - player.y - wall5a.height) + player.y + wall5a.height / 2;
}
@@ -360,10 +360,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall6a.x -= 10;
- wall6b.x += 10;
+ wall6a.x -= 20;
+ wall6b.x += 20;
if (wall6a.x < -wall6a.width / 2) {
wall6a.x = 2048 + wall6a.width / 2;
wall6a.y = Math.random() * (gate.y - player.y - wall6a.height) + player.y + wall6a.height / 2;
}
@@ -410,10 +410,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall7a.x -= 10;
- wall7b.x += 10;
+ wall7a.x -= 22;
+ wall7b.x += 22;
if (wall7a.x < -wall7a.width / 2) {
wall7a.x = 2048 + wall7a.width / 2;
wall7a.y = Math.random() * (gate.y - player.y - wall7a.height) + player.y + wall7a.height / 2;
}
@@ -460,10 +460,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall8a.x -= 10;
- wall8b.x += 10;
+ wall8a.x -= 24;
+ wall8b.x += 24;
if (wall8a.x < -wall8a.width / 2) {
wall8a.x = 2048 + wall8a.width / 2;
wall8a.y = Math.random() * (gate.y - player.y - wall8a.height) + player.y + wall8a.height / 2;
}
@@ -510,10 +510,10 @@
x: 1024,
y: 125
});
self.update = function () {
- wall9a.x -= 10;
- wall9b.x += 10;
+ wall9a.x -= 26;
+ wall9b.x += 26;
if (wall9a.x < -wall9a.width / 2) {
wall9a.x = 2048 + wall9a.width / 2;
wall9a.y = Math.random() * (gate.y - player.y - wall9a.height) + player.y + wall9a.height / 2;
}