Code: Tilt-a-Board

This is the final version of the game code from Chapter 15, ​Project: Tilt-a-Board​, including the two bonus challenges:

​ <body></body>
​ <script src=​"/three.js"​></script>
​ <script src=​"/physi.js"​></script>
​ <script src=​"/spe.js"​></script>
​ <script>
​  ​// Physics settings​
​  Physijs.scripts.ammo = ​'/ammo.js'​;
​  Physijs.scripts.worker = ​'/physijs_worker.js'​;
​ 
​  ​// The "scene" is where stuff in our game will happen:​
​  ​var​ scene = ​new​ Physijs.Scene();
​  scene.setGravity(​new​ THREE.Vector3( 0, -100, 0 ));
​  ​var​ flat = {flatShading: ​true​};
​  ​var​ light = ​new​ THREE.AmbientLight(​'white'​, 0.2);
​ 

Get 3D Game Programming for Kids, 2nd Edition 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.