3D Game Programming

(C. Jardin) #1
Don’t worry about the Object[objectObject] part of the message, as it’s not telling
us anything helpful at this point.

In this case, we told the browser that there was a method named ad(), but it
was unable to find any information in the file. The fix is the same as in previ-
ous examples. The method we should have is add(), not ad(). In other words,
we do not want to ad the ball to the screen; we want to add it.

After fixing that line, you’ll finally see a ball and the “Nom. Nom. Nom.” mes-
sage appear in the Javascript console.

2.6 Recovering When ICE Is Broken


It is surprisingly easy to break a web browser. If you create a sphere with a
million chunks, the browser will break. If you create a recursive function with
no stopping point (we’ll talk about those in Functions: Use and Use Again),
the browser will break.

If the browser is broken, then the ICE Code Editor is broken, right?


Well, yes, but there’s an easy way to fix it: add ?e or ?edit-only to the URL so
that you’re looking at http://gamingjs.com/ice/?e. This is edit-only mode for ICE.

report erratum • discuss

Recovering When ICE Is Broken • 23


Prepared exclusively for Michael Powell

Free download pdf