Help with bug in Game Lab

Hi,

One of my students created this game, but he’s having an issue that neither of us can figure out.
The error message is saying mySpike is undefined, but we don’t understand why.
He wants there to be a group of spikes.

Here’s the project:

Thanks for any help you can offer!

Kim

Hi,

There’s a lot going on with this program but I think that the reasons that mySpikes is not a group of spikes is because there is a syntax problem on line 22 (an extra semicolon), which is causing that for loop not to run properly.

There’s also another big problem with the area of code between lines 44 and 49 that it looks like the student hasn’t closed the for loop properly, so there are way too many things happening in that for loop. That will also cause a lot of errors.

For now, the student might want to occasionally switch back into block mode to double check that no errors like this have been introduced. Block mode will catch some of these syntax problems. Also, frequent testing of the code as more features are added will help. Right now there’s so much going on that is messy and with errors that it’s hard to hunt down the bugs. Testing as they go will make it easier to find the bug much faster, both because they know what they’ve changed recently and because it’ll be less likely that there are many bugs all interacting in strange ways.

Elizabeth