User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'move')' in this line: 'moneyArray[a].move();' Line Number: 27
User prompt
Fix Bug: 'TypeError: Cannot read properties of undefined (reading 'move')' in this line: 'moneyArray[a].move();' Line Number: 27
Initial prompt
Money Clicker
===================================================================
--- original.js
+++ change.js
@@ -22,9 +22,9 @@
if (isGameOver) {
LK.effects.flashScreen(0xff0000, 1000);
LK.showGameOver();
}
- for (var a = moneyArray.length; a >= 0; a--) {
+ for (var a = moneyArray.length - 1; a >= 0; a--) {
moneyArray[a].move();
if (moneyArray[a].y > 2732) {
moneyArray[a].destroy();
moneyArray.splice(a, 1);