Let’s Make Physics!

For this game, we need two new JavaScript libraries and a few configuration settings. At the very top of the file, add two new <script> tags:

 
<body>​​</body>
 
<script​ src=​"http://gamingJS.com/Three.js"​​>​​</script>
​ 
<script​ src=​"http://gamingJS.com/physi.js"​​>​​</script>
​ 
<script​ src=​"http://gamingJS.com/Scoreboard.js"​​>​​</script>
 
<script​ src=​"http://gamingJS.com/ChromeFixes.js"​​>​​</script>

We’re going to use physics in this game. We use the Physijs library so we don’t have to write all the physics code ourselves.

This library will help keep score in the game.

Then, at the top of the code from the 3D starter project template, just below the <script> tag without an src attribute, make ...

Get 3D Game Programming for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.