3D Game Programming

(C. Jardin) #1

CHAPTER 9


What’s All That Other Code?


When we create a new project from the 3Dstarter template, there is a lot of code
already in there. In this chapter we’ll see what it all means.

10.1 Getting Started


Create a new project from the 3DStarter template in the ICE Code Editor. Name
the project All that other code.

9.2 A Quick Introduction to HTML


At the very top of our code is the following HTML:


<body></body>

HTML is not a programming language. So what’s it doing messing up our
beautiful JavaScript code?

HTML is the Hypertext Markup Language. It is used to build web pages, not
to make web pages do interesting things.

Even though it’s not a programming language, we still need HTML for Java-
Script. Since JavaScript is a web programming language, we need a web page
where we can program—even if it is just a simple page.

The very first line contains an opening and closing <body> tag. In between
those two tags, HTML authors would normally put writing—links to images
and other pages. We’re not putting anything in there because we’re program-
ming, not making web pages.

To get a sense of what HTML does, add the following HTML in between the
two <body> tags, as shown:

When you’re done with this chapter, you will


  • Know a little about making web pages

  • Understand the starter code

  • Be comfortable changing the starter code


Prepared exclusively for Michael Powell report erratum • discuss

Free download pdf