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
User prompt
Remove wall1 from respawning in level2
User prompt
Remove Ensure function Wall1 objects are not respawning in level 2
User prompt
Remove vertical wall5
User prompt
Make only horizontal wall5 from left to right and another one left to right
User prompt
Don't respawn wall1 in level2
User prompt
Stop respawning wall1 in other level then level1
User prompt
Mall wall1 have same speed
User prompt
Increase speed
User prompt
Make the small wall1 big a bit
User prompt
Make the background1 behind all walls
User prompt
Reduce walls in level1
User prompt
Add collision to wall1
/**** * 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,