Code edit (1 edits merged)
Please save this source code
User prompt
Migrate to the latest version of LK
Code edit (1 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) + ' - Get ' + levels[currentLevel][0] + ' out of ' + levels[currentLevel][1] + ' shapes');' Line Number: 232
Code edit (19 edits merged)
Please save this source code
User prompt
in on tick if (currentLevel == levels.length) call game over
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -228,9 +228,13 @@
}
isClicked = false;
collisionsCount = 0;
self.expandedCount = 1;
- levelText.setText('Level ' + (currentLevel + 1) + ' - Get ' + levels[currentLevel][0] + ' out of ' + levels[currentLevel][1] + ' shapes');
+ if (currentLevel < levels.length) {
+ levelText.setText('Level ' + (currentLevel + 1) + ' - Get ' + levels[currentLevel][0] + ' out of ' + levels[currentLevel][1] + ' shapes');
+ } else {
+ levelText.setText('All levels completed!');
+ }
return;
}
if (self.staticShape && self.staticShape.update) self.staticShape.update();
shapes.forEach(function (shape) {
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.