Code: Tilt-a-Board

This is the final version of the game code from Chapter 16, Project: Tilt-a-Board.

 
<body>​</body>
 
<script src="http://gamingJS.com/Three.js​"></script>
 
<script src="​http:​//gamingJS.com/physi.js"></script>
 
<script src="http://gamingJS.com/ChromeFixes.js">​</script>
 
<script>
 
// Physics settings
 
Physijs.scripts.ammo = ​'http://gamingJS.com/ammo.js'​;
 
Physijs.scripts.worker = ​'http://gamingJS.com/physijs_worker.js'​;
 
 
// This is where stuff in our game will happen:
 
var​ scene = ​new​ Physijs.Scene({ fixedTimeStep: 2 / 60 });
 
scene.setGravity(​new​ THREE.Vector3( 0, -50, 0 ));
 
 
// This is what sees the stuff:
 
var​ aspect_ratio = window.innerWidth / window.innerHeight;
 
var​ camera = ​new ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.