I\'m making a 2D, top-down Zelda style web rpg single player in JavaScript.
When the player (purple shirt) walks near a cat, it will \"rescue\" it... which basically rem
It may be possible that your rescuedTotal_Array is an associative Array (or was morphed to one) and could contain something like:
rescuedTotal_Array = [1:object,2:object,object:object]
The array above has the length of 3. But you cannot access the third element via index 2, because its index is some kind of object.
Try to dump the content of your rescuedTotal_Array before accessing it (so you can see if everything is ok). This is not a solution, but it may help you so that you can find the error by yourself. Use something like
for (index in rescuedTotal_Array) {
if (rescuedTotal_Array.hasOwnProperty(index)) {
console.log(rescuedTotal_Array[index]);
}
else {
console.log("no entry found for index: "+index);
}
}