Found a few problems in Chapter 7 of the book.

When you create the MeanBat object, step 9 on page 191 references a coin, but it means bat. But the big thing is they don’t tell you to check the Callback checkbox in the World Limits rollout.

Without that the enemy bats will just keep flying instead of turning around and wreaking havoc (which is what we want).

Code problems — the code on page 194 (and repeated on page 196) has three problems — all the same thing is wrong.

You’ll see reference to this in some of the lines:

%this.getRandom(%this.minSpeed, %this.maxSpeed)

That won’t work because there is no getRandom() function that’s part of the %this object — what should be there is this:

getRandom(%this.minSpeed, %this.maxSpeed)

That’s right, just knock off the %this. and you should be good. You’ll find that error in three different places in the code.

Also on those pages you’ll see a couple “case” statements, like this:

case "left"

You need to add a colon to the end of that:

case "left":

Do the same thing for the case “right” statement.