Greetings:
I’ve made it to about Step 13 on this project. This is where lots of people seem to get hamstrung, myself included. I’ve successfully filled the board with cubes, but now, nothing happens when I click on them. Here are the two additions to the code I made based on the instructions:
const matches = checkClosest(curr);
console.log(matches);
matches.forEach(match => {match.removed = true;
validNeighborCubes.push(match);
cubesToCheck.push(match);})
and
if (neighborCubes.length > 0) {
// Update score
score += neighborCubes.length;
scoreText.setText(`Score: ${score}`);
// Update each cube in neighborCubes here
neighborCubes.forEach(neighbor => {neighbor.destroy();
renderCubes(neighbor);
removeCols();
});
As you can see in the first one, I added a console statement to see what’s inside the matches variable, and whatever I click, it appears taht nothing is going into that variable. I just get: in the console, over and over. I’m at a loss right now.