User prompt
Make player bigger and front of draw asset
User prompt
Please fix the bug: 'TypeError: lineGraphics.lineStyle is not a function' in or related to this line: 'lineGraphics.lineStyle(2, 0xffffff, 1);' Line Number: 19
User prompt
When player moves draw a line by white color
User prompt
make movement of player smoothly forward to the cursor
User prompt
move player horizontal or vertical to the cursor with large distance and stop.
User prompt
Make the player move only 4 direction when click left go left if right go right so on
User prompt
Set draw asset behind player
User prompt
Make the player bigger then draw
User prompt
Please fix the bug: 'Draw is not defined' in or related to this line: 'var draw = new Draw();' Line Number: 65
User prompt
Make player movement by directions right left horizontally and up and down vertically
User prompt
remove draw from screen but let its asset
User prompt
Please fix the bug: 'TypeError: drawGraphics.lineTo is not a function' in or related to this line: 'drawGraphics.lineTo(player.x, player.y);' Line Number: 63
User prompt
Please fix the bug: 'TypeError: drawGraphics.lineTo is not a function' in or related to this line: 'drawGraphics.lineTo(player.x, player.y);' Line Number: 62
User prompt
Please fix the bug: 'TypeError: drawGraphics.moveTo is not a function' in or related to this line: 'drawGraphics.moveTo(player.x, player.y);' Line Number: 60
User prompt
Please fix the bug: 'TypeError: drawGraphics.moveTo is not a function' in or related to this line: 'drawGraphics.moveTo(player.x, player.y);' Line Number: 59
User prompt
Please fix the bug: 'ReferenceError: player is not defined' in or related to this line: 'drawGraphics.moveTo(player.x, player.y);' Line Number: 53
User prompt
Please fix the bug: 'TypeError: drawGraphics.lineStyle is not a function' in or related to this line: 'drawGraphics.lineStyle(2, 0xffd900, 1);' Line Number: 52
User prompt
Please fix the bug: 'TypeError: drawGraphics.setStrokeStyle is not a function' in or related to this line: 'drawGraphics.setStrokeStyle(2, 0xffd900, 1);' Line Number: 52
User prompt
Please fix the bug: 'TypeError: drawGraphics.setStrokeStyle is not a function' in or related to this line: 'drawGraphics.setStrokeStyle(2, 0xffd900, 1);' Line Number: 52
User prompt
Please fix the bug: 'TypeError: drawGraphics.lineStyle is not a function' in or related to this line: 'drawGraphics.lineStyle(2, 0xffd900, 1);' Line Number: 52
User prompt
Please fix the bug: 'ReferenceError: drawGraphics is not defined' in or related to this line: 'drawGraphics.clear();' Line Number: 47
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'update')' in or related to this line: 'self.update = function () {' Line Number: 46
User prompt
Please fix the bug: 'Cannot set properties of undefined (setting 'update')' in or related to this line: 'self.update = function () {' Line Number: 45
User prompt
Make new asset name it draw make it follow player when moves and draw line
User prompt
make the maze1 behind wall
/**** * Classes ****/ var Draw = Container.expand(function () { var self = Container.call(this); var drawGraphics = self.attachAsset('draw', { anchorX: 0.5, anchorY: 0.5 }); self.update = function () { drawGraphics.clear(); // There is no lineStyle method in LK engine. We can set the color of the shape directly when initializing it. drawGraphics.x = player.x; drawGraphics.y = player.y; drawGraphics.x = player.x; drawGraphics.y = player.y; }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var background = game.addChild(LK.getAsset('maze1', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 })); background.scale.x = game.width / background.width; background.scale.y = game.height / background.height; var player = game.addChild(LK.getAsset('player', { anchorX: 0.5, anchorY: 0.5, x: 2048 / 2, y: 2732 / 2 })); var draw = new Draw(); var drawGraphics = draw.attachAsset('draw', { anchorX: 0.5, anchorY: 0.5 }); var self = game; self.update = function () { drawGraphics.clear(); drawGraphics.x = player.x; drawGraphics.y = player.y; drawGraphics.x = player.x; drawGraphics.y = player.y; };
===================================================================
--- original.js
+++ change.js
@@ -40,19 +40,17 @@
anchorY: 0.5,
x: 2048 / 2,
y: 2732 / 2
}));
-var draw = game.addChild(new Draw());
+var draw = new Draw();
var drawGraphics = draw.attachAsset('draw', {
anchorX: 0.5,
anchorY: 0.5
});
var self = game;
self.update = function () {
drawGraphics.clear();
- // There is no lineStyle method in LK engine. We can set the color of the shape directly when initializing it.
drawGraphics.x = player.x;
drawGraphics.y = player.y;
- // In LK engine, there is no lineTo method. We can set the position of the shape directly.
drawGraphics.x = player.x;
drawGraphics.y = player.y;
};
\ No newline at end of file