2D Game Building for Teens – Errata #2

Here’s another big problem from the book 2D Game Building for Teens. Yes, the code examples are in rotten shape but the book as a whole is a good intro to Torque Game Builder — just make sure you keep checking back here for the fixes. =;)

On pages 163 and 169 the book shows the code for player.cs — and besides the problem shown in Errata #1 on this site, there is a huge chunk of the code shown that shouldn’t be there.

Basically, these functions…

BattyPlayerUp()
BattyPlayerDown()
BattyPlayerLeft()
BattyPlayerRight()

…are duplicated.

The first set shouldn’t be there — just rip those four functions right out and you should be good to go.

(Posted in: Torque 2D, Torque Game Builder, TorqueScript)

2D Game Building for Teens – Errata #1

The book, “2D Game Building for Teens” by Michael Duggan is the only book I’ve seen that covers Torque Game Builder — and since my son Tom is 15 I figured this book would be a great starting point for him.

Yes, and no. The book itself is very cool — but the code examples have some major problems.

My son spent hours getting to a point in the book where things just stopped working…

…the w, a, s, and d keys are supposed to move a flapping bat around on the screen.

Nada.

He spent hours trying to figure out what was wrong — he’s not a programmer (yet) so he had no idea what to look for. I finally found it after spending too long trying to find the typo in his code — turned out it’s a mistake in the book, he typed everything in correctly.

Hey, mistakes happen, right? So where’s the errata on the author or publisher site? It’s just freakin’ irresponsible not to have that available — especially for something that’s aimed at newbies.

So, for anybody else who comes across this problem, it’s caused by this line in player.cs:

$MeBatty = %this;

In that line you’re setting the global variable $MeBatty to the object that’s passed in to the function, but then other functions are referring to $BattyPlayer, not $MeBatty.

To fix player.cs (the full thing starts on the bottom of page 155 in 2D Game Building for Teens), just replace that $MeBatty line with this:

$BattyPlayer = %this;

Your bat should now fly around using the w, a, s, and d keys.

(Posted in: Torque 2D, Torque Game Builder, TorqueScript)

What Is TorqueNation?

It’s a place where people who write in TorqueScript or who use Torque Game Builder, Torque 3D, etc., can find tutorial videos, code snippets, etc.

Of course the GG site itself has a community of people who can’t be beat, so why TorqueNation? Because it’s good to be the king.

I mean, so there’s a place my son and I can post things about Torque and I don’t have to worry about whether it’s in the right spot, etc. Oh, and so I can try and monetize my work with Torque.

How’s that for being up-front and honest? =:)

Anyway, I hope as this site grows you will find information that will help you develop your own games using the Torque products.

(Posted in: Miscellaneous)