User prompt
reposition both to the boundaries of screen
User prompt
move them to the sides wall2 to the right an 3 to the left
User prompt
Make the vertical walls thin
User prompt
Make the bottom wall1 reach the right wall2 on the right side but let the space in the corner empty
User prompt
Make the wall of the bottom reach the both walls of left and right and let the corner between it empty.
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'height')' in or related to this line: 'wall3.y = wall2.height; // Position wall3 below the top wall' Line Number: 67
User prompt
Fix the walls around the screen to be smooth and with correct positioning.
Code edit (1 edits merged)
Please save this source code
User prompt
Decrease the distance beetween cursor and the player.
User prompt
Remove plugins
User prompt
set the player with same position of the cursor.
User prompt
Drag the player with mouse arrow not far from it.
User prompt
Add drag by mouse again
User prompt
remove what's stopping the player from moving with the mouse button
User prompt
make the player can be dragged by holding cursor on the player.
User prompt
if the mouse button clicked and held make the player follow it exact same time.
User prompt
make hold on object to dreg it on any place in the screen area, if the mouse button not clicked release the object.
User prompt
remove any movement of the player.
User prompt
Generate a maze on the space between all 4 walls of the sides with medium size of walls, make fusion shames for more difficulty.
User prompt
Add many small walls constrained to each other with random shapes between the 4 walls as a small generated maze.
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'attachAsset')' in or related to this line: 'self.attachAsset('wall1', {' Line Number: 35
User prompt
Add many small walls with random shapes inside the 4 walls of the sides like a small maze with many walls.
User prompt
Add color 1 make it the color that player do it when it moves on the screen.
User prompt
Make the walls not passable
User prompt
Add another wall horizontal for the bottom
/**** * Classes ****/ // Class for the player character var Player = Container.expand(function () { var self = Container.call(this); self.interactive = true; // Make the player interactive var playerGraphics = self.attachAsset('player', { anchorX: 1.9, anchorY: 1.9 }); self.dragging = false; // Add a variable to track if the player is being dragged }); // Class for the wall var Wall = Container.expand(function () { var self = Container.call(this); var wallGraphics = self.attachAsset('wall1', { anchorX: 0.05, anchorY: 0.05 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Add background to the game var background = game.attachAsset('Background1', { anchorX: 0.5, anchorY: 1, x: 2048 / 2, y: 2732, scaleX: 2048 / 1000, scaleY: (2732 - LK.gui.top.height - 200) / 1000 // Scale down from the top by 200 pixels }); // Set level to 1 game.level = 1; // Initialize player var player = new Player(); player.x = 0 + player.width; player.y = 2732; player.interactive = true; game.addChild(player); // Initialize wall1 var wall1 = new Wall(); wall1.x = 0; // Move wall1 to the left edge of the screen // Initialize wall2 var wall2 = new Wall(); wall2.x = 0; // Move wall2 to the left edge of the screen wall2.y = 0; // Position wall2 at the top of the screen wall2.width = 100; // Make wall2 thinner wall2.height = 200; // Keep wall2's height the same game.addChild(wall2); // Now we can use wall2.height wall1.y = wall2.height; // Position wall1 below the top wall wall1.width = 50; // Make wall1 thin vertically wall1.height = 2732 - 100; // Make wall1 as tall as the screen, leaving a gap in the corner game.addChild(wall1); // Initialize wall3 on the right side of the screen var wall3 = new Wall(); wall3.x = 2048 - wall3.width; // Move wall3 to the right edge of the screen wall3.y = wall2.height; // Position wall3 below the top wall wall3.width = 50; // Make wall3 thinner wall3.height = 2732; // Keep wall3's height the same game.addChild(wall3); // Initialize wall4 at the top of the screen var wall4 = new Wall(); wall4.x = 0; // Position wall4 at the left edge of the screen wall4.y = 0; // Position wall4 at the top of the screen wall4.width = 2048; // Make wall4 as wide as the screen wall4.height = 200; // Make wall4 taller horizontally game.addChild(wall4); // Initialize wall2 var wall2 = new Wall(); wall2.x = 100; // Move wall2 a little bit more to the right wall2.y = 0; // Position wall2 at the top of the screen wall2.width = 2048; // Make wall2 as wide as the screen wall2.height = 200; // Make wall2 taller horizontally game.addChild(wall2); // Add Level 1 text on the top right var levelText = new Text2('Level 1', { size: 100, fill: 0xFFFFFF, font: "'Time new roman'" }); levelText.anchor.set(1, 0); // Sets anchor to the top right edge of the text. LK.gui.topRight.addChild(levelText); // Handle player movement // Import tween plugin var dragNode = null; game.down = function (x, y, obj) { dragNode = player; }; game.move = function (x, y, obj) { if (dragNode) { dragNode.x = x - dragNode.width / 10; dragNode.y = y - dragNode.height / 10; } }; game.up = function (x, y, obj) { dragNode = null; };
===================================================================
--- original.js
+++ change.js
@@ -42,18 +42,18 @@
// Set level to 1
game.level = 1;
// Initialize player
var player = new Player();
-player.x = 2048;
+player.x = 0 + player.width;
player.y = 2732;
player.interactive = true;
game.addChild(player);
// Initialize wall1
var wall1 = new Wall();
-wall1.x = 2048 - wall1.width - 100; // Move wall1 to the right edge of the screen, leaving a gap in the corner
-// Initialize wall2 first to get its height
+wall1.x = 0; // Move wall1 to the left edge of the screen
+// Initialize wall2
var wall2 = new Wall();
-wall2.x = 2048 - wall2.width; // Move wall2 to the right edge of the screen
+wall2.x = 0; // Move wall2 to the left edge of the screen
wall2.y = 0; // Position wall2 at the top of the screen
wall2.width = 100; // Make wall2 thinner
wall2.height = 200; // Keep wall2's height the same
game.addChild(wall2);
@@ -61,19 +61,19 @@
wall1.y = wall2.height; // Position wall1 below the top wall
wall1.width = 50; // Make wall1 thin vertically
wall1.height = 2732 - 100; // Make wall1 as tall as the screen, leaving a gap in the corner
game.addChild(wall1);
-// Initialize wall3 on the left side of the screen
+// Initialize wall3 on the right side of the screen
var wall3 = new Wall();
-wall3.x = 0 + wall3.width; // Move wall3 a little bit more to the right
+wall3.x = 2048 - wall3.width; // Move wall3 to the right edge of the screen
wall3.y = wall2.height; // Position wall3 below the top wall
wall3.width = 50; // Make wall3 thinner
wall3.height = 2732; // Keep wall3's height the same
game.addChild(wall3);
-// Initialize wall4 at the bottom of the screen
+// Initialize wall4 at the top of the screen
var wall4 = new Wall();
wall4.x = 0; // Position wall4 at the left edge of the screen
-wall4.y = 2732 - wall4.height; // Position wall4 at the bottom of the screen
+wall4.y = 0; // Position wall4 at the top of the screen
wall4.width = 2048; // Make wall4 as wide as the screen
wall4.height = 200; // Make wall4 taller horizontally
game.addChild(wall4);
// Initialize wall2