User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'height')' in or related to this line: 'var player = self.attachAsset('player', {' Line Number: 94
User prompt
Make the player at the bottom
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'height')' in or related to this line: 'var player = self.attachAsset('player', {' Line Number: 94
User prompt
Make the player position for all levels in bottom middle side.
User prompt
Add collision to player and wall1
User prompt
Add player to the game
User prompt
Scale the text of the level
User prompt
Add level text top right with orange color
User prompt
Move the level text to the middle of screen
User prompt
Make the text of level bigger
User prompt
Center it
User prompt
Make level text inside the screen
Code edit (2 edits merged)
Please save this source code
User prompt
Move level text to the top right corner
User prompt
Change it to the right and make it bigger
User prompt
Add level text top left with orange color
User prompt
Make the walls respawn only inside screen boundaries.
User prompt
Increase walls in level1 and speed.
User prompt
Make random respawning of wall1
User prompt
Fit the background image to all the screen
User prompt
Make the background fit to screen 800x800
User prompt
Add level 1 with background1 and 2 wall1 moving horizontally from right to left and from left to right.
Code edit (1 edits merged)
Please save this source code
User prompt
Respawn wall1 in level1 only
User prompt
Please fix the bug: 'ReferenceError: Wall5 is not defined' in or related to this line: 'if (level === 5 && game.children[i] instanceof Wall5 && player.intersects(game.children[i]) && game.children[i].visible) {' Line Number: 1243
/**** * 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 }); self.update = function () { wall1a.x -= 5; wall1b.x += 5; if (wall1a.x < -wall1a.width / 2) { wall1a.x = 2048 + wall1a.width / 2; } if (wall1b.x > 2048 + wall1b.width / 2) { wall1b.x = -wall1b.width / 2; } }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var level1 = game.addChild(new Level1());
===================================================================
--- original.js
+++ change.js
@@ -5,10 +5,12 @@
var self = Container.call(this);
var background = self.attachAsset('Background1', {
anchorX: 0.5,
anchorY: 0.5,
- x: 400,
- y: 400
+ x: 1024,
+ y: 1366,
+ scaleX: 2048 / 800,
+ scaleY: 2732 / 800
});
var wall1a = self.attachAsset('wall1', {
anchorX: 0.5,
anchorY: 0.5,