I’m really stuck on this level. Tried about every possible way using other posts but I was unable to get my character to get anything more than 3 coins. Now he just stands in the middle. Any help? thanks.
That was my next thing after reading some other games I completed. However I cannot get back into this specific one, it crashes on loading. Doesn’t give the option to comment out code like before. I must have messed something up with it.
Plz help me with my code. I don’t get what I did wrong.
loop {
var coins = this.findItems();
var coinIndex = 0;
// Wrap this into a loop that iterates over all coins.
while (coinIndex < coins.length) {
var coin = coins[coinIndex];
// Gold coins are worth 3.
if (coin.value == 3) {
// Only pick up gold coins.
this.moveXY(coin.pos.x, coin.pos.y);
}
coinIndex += 1;
}