User prompt
make the image can be dragged by any point in it not just from center of it.
User prompt
Make the Image follow the cursor by click in exact same time
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getLocalPosition')' in or related to this line: 'var newPosition = self.data.getLocalPosition(self.parent);' Line Number: 77
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getLocalPosition')' in or related to this line: 'var newPosition = self.data.getLocalPosition(self.parent);' Line Number: 77
User prompt
Move the image in exact same time with the cursor to avoid the vibrating of the image when dragge it.
User prompt
Increase the speed movement of the background1 image
User prompt
don't center the image let it move freely from the clicked point and don't teleport the image to the cursor
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getLocalPosition')' in or related to this line: 'var newPosition = self.data.getLocalPosition(self.parent);' Line Number: 73
User prompt
let the dragge be smooth for no vibration from the background1 image
User prompt
make the background1 bigger
User prompt
Please fix the bug: 'Uncaught TypeError: Cannot read properties of undefined (reading 'getLocalPosition')' in or related to this line: 'var newPosition = self.data.getLocalPosition(self.parent);' Line Number: 71
User prompt
Add dragge to the background1 image
User prompt
remove the duplication of the background1!
User prompt
make the background 1 in the center of the screen
User prompt
add other levels and there backgrounds to the game
User prompt
Add level1 class and background1 class
User prompt
Add its background1
User prompt
Add level to the game
Code edit (1 edits merged)
Please save this source code
User prompt
remove numbers close to stone asset 00 and the 2
User prompt
remove score of wood
User prompt
remove the 00 and 2 in stone score
User prompt
remove bronze second score text and for stone the double 00
User prompt
Please fix the bug: 'text6 is not defined' in or related to this line: 'var crystal = LK.getAsset('crystal', {' Line Number: 1101
User prompt
Please fix the bug: 'text4 is not defined' in or related to this line: 'var silver = LK.getAsset('silver', {' Line Number: 1074
/**** * Classes ****/ var Level1 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background1' with the anchor point set to 0, 0 var background1 = self.attachAsset('background1', { anchorX: 0.5, anchorY: 0.5, x: 1024, y: 1366, scaleX: 1.5, scaleY: 1.5 }); // Add drag functionality to the background1 image self.down = function (x, y, obj) { self.dragging = true; self.data = obj.data; }; self.up = function () { self.dragging = false; self.data = null; }; self.move = function (x, y, obj) { if (self.dragging) { var newPosition = self.data.getLocalPosition(self.parent); self.x = newPosition.x; self.y = newPosition.y; } }; }); // Create a Level2 class by using the LK expand method to extend Container. var Level2 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background2' with the anchor point set to 0, 0 var background2 = self.attachAsset('background2', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Level3 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background3' with the anchor point set to 0, 0 var background3 = self.attachAsset('background3', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Level4 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background4' with the anchor point set to 0, 0 var background4 = self.attachAsset('background4', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); var Level5 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background5' with the anchor point set to 0, 0 var background5 = self.attachAsset('background5', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); // Create a Level6 class by using the LK expand method to extend Container. var Level6 = Container.expand(function () { var self = Container.call(this); // Get and automatically addChild to self asset with id 'background6' with the anchor point set to 0, 0 var background6 = self.attachAsset('background6', { anchorX: 0.0, anchorY: 0.0, x: 0, y: 0 }); }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var level = game.addChild(new Level1());
===================================================================
--- original.js
+++ change.js
@@ -22,10 +22,11 @@
self.data = null;
};
self.move = function (x, y, obj) {
if (self.dragging) {
- self.x = x;
- self.y = y;
+ var newPosition = self.data.getLocalPosition(self.parent);
+ self.x = newPosition.x;
+ self.y = newPosition.y;
}
};
});
// Create a Level2 class by using the LK expand method to extend Container.
2D wreckage of wood, square, HD colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
House from the front facing the screen with big sign above it have description "SHOP", Hd colors
coin, have "AD" not "$", hd colors. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows