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
User prompt
Please fix the bug: 'maze1 is not defined' in or related to this line: 'if (maze1[i][j] == 1) {' Line Number: 40
User prompt
Make the wall on all the yellow lines of the image maze1 with same scale.
User prompt
Add the wall and player to the game
User prompt
Make walls similar as in the image of maze1
User prompt
Make the screen image always smooth and clearer each time of loading the game or new level.
User prompt
Make it 1000x1000 and fit it to the screen
/**** * Classes ****/ var Draw = Container.expand(function () { var self = Container.call(this); return self; }); var Player = Container.expand(function () { var self = Container.call(this); var playerGraphics = self.attachAsset('player', { anchorX: 0.5, anchorY: 0.5, scaleX: 2, scaleY: 2 }); self.speed = 5; self.moveRight = function () { self.x += self.speed; }; self.moveLeft = function () { self.x -= self.speed; }; self.moveUp = function () { self.y -= self.speed; }; self.moveDown = function () { self.y += self.speed; }; }); /**** * 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(new Player()); player.x = 2048 / 2; player.y = 2732 / 2; game.down = function (x, y, obj) { if (x > player.x) { player.moveRight(); } else { player.moveLeft(); } if (y > player.y) { player.moveDown(); } else { player.moveUp(); } }; var draw = new Draw(); var drawGraphics = draw.attachAsset('draw', { anchorX: 0.5, anchorY: 0.5 }); game.addChildAt(draw, 0); 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
@@ -60,13 +60,14 @@
} else {
player.moveUp();
}
};
-var draw = game.addChild(new Draw());
+var draw = new Draw();
var drawGraphics = draw.attachAsset('draw', {
anchorX: 0.5,
anchorY: 0.5
});
+game.addChildAt(draw, 0);
var self = game;
self.update = function () {
drawGraphics.clear();
drawGraphics.x = player.x;