Code edit (5 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '0')' in this line: 'levelText.setText('Level ' + (currentLevel + 1) + ' - Explode ' + levels[currentLevel][0] + ' of ' + levels[currentLevel][1] + ' shapes');' Line Number: 207
Code edit (7 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading '1')' in this line: 'for (var i = 0; i < levels[currentLevel][1]; i++) {' Line Number: 198
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'undefined')' in this line: 'levelText.setText('Level 1 - Explode ' + self.levels[self.currentLevel][0] + ' of ' + self.levels[self.currentLevel][0] + ' shapes');' Line Number: 204
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'undefined')' in this line: 'if (collisionsCount > self.levels[self.currentLevel][0]) {' Line Number: 188
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'expandedCount')' in this line: 'self.parent.expandedCount--;' Line Number: 136
User prompt
Fix Bug: 'Timeout.tick error: Cannot read properties of undefined (reading 'expandedCount')' in this line: 'self.parent.expandedCount--;' Line Number: 136
Code edit (1 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: expandedCount is not defined' in this line: 'expandedCount++;' Line Number: 205
Code edit (2 edits merged)
Please save this source code
User prompt
Fix Bug: 'ReferenceError: expandedCount is not defined' in this line: 'expandedCount++;' Line Number: 205
User prompt
Fix Bug: 'ReferenceError: collisionsText is not defined' in this line: 'collisionsText.setText('Wow');' Line Number: 197
User prompt
Fix Bug: 'ReferenceError: collisionsText is not defined' in this line: 'collisionsText.setText('Wow');' Line Number: 187
User prompt
Fix Bug: 'ReferenceError: expandedCount is not defined' in this line: 'if (expandedCount == 0) {' Line Number: 185
User prompt
define a global var expandedTestCount
Code edit (8 edits merged)
Please save this source code
User prompt
Fix Bug: 'Timeout.tick error: expandedCount is not defined' in this line: 'expandedCount--;' Line Number: 72
Code edit (1 edits merged)
Please save this source code
Code edit (3 edits merged)
Please save this source code
User prompt
Fix Bug: 'Uncaught TypeError: Shape.hsvToRgb is not a function' in this line: 'var bgColor = Shape.hsvToRgb(1, 1, 1);' Line Number: 156
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -144,9 +144,9 @@
var self = Container.call(this);
self.expandedCount = 1;
LK.stageContainer.setBackgroundColor('0xCCCCFF');
var currentLevel = 0;
- var levels = [[1, 5], [3, 40], [6, 9], [8, 12], [10, 15], [15, 20], [18, 25], [1, 7], [6, 9], [8, 12], [10, 15], [15, 20]];
+ var levels = [[1, 5], [3, 80], [6, 9], [8, 12], [10, 15], [15, 20], [18, 25], [25, 32], [30, 40], [35, 50], [50, 65], [80, 80], [100, 100]];
var shapes = [];
var levelText = new Text2('Level 1 - Explode 1 of 5 shapes', {
size: 80,
fill: "#ffffff",
@@ -185,9 +185,9 @@
});
LK.on('tick', function () {
if (self.expandedCount == 0) {
if (collisionsCount >= levels[currentLevel][0]) {
- collisionText.setText('Level Completed - Welcome to the next');
+ collisionText.setText('Level Completed - now try this');
currentLevel++;
} else {
collisionText.setText('Try again');
}
@@ -203,9 +203,13 @@
}
isClicked = false;
collisionsCount = 0;
self.expandedCount = 1;
- levelText.setText('Level ' + (currentLevel + 1) + ' - Explode ' + levels[currentLevel][0] + ' of ' + levels[currentLevel][1] + ' shapes');
+ if (currentLevel < levels.length) {
+ levelText.setText('Level ' + (currentLevel + 1) + ' - Explode ' + levels[currentLevel][0] + ' of ' + levels[currentLevel][1] + ' shapes');
+ } else {
+ levelText.setText('Level ' + (currentLevel + 1) + ' - No more levels');
+ }
return;
}
shapes.forEach(function (shape) {
shape.move();
a white geometric square shape Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
a white dot Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
flat white round disk Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.
gif circle spinning animation Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows.