July 2018
Beginner to intermediate
374 pages
8h 54m
English
This is the final version of the game code from Chapter 18, Project: Two-Player Games:
| | <script src="/three.js"></script> |
| | <script src="/physi.js"></script> |
| | <script src="/scoreboard.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({ fixedTimeStep: 2 / 60 }); |
| | scene.setGravity(new THREE.Vector3( 0, -100, 0 )); |
| | var flat = {flatShading: true}; |
| | var light = new THREE.HemisphereLight('white', 'grey', 0.7); |
| | scene.add(light); |
| | |
| | // The "camera" is what sees the stuff: |
| | var width = window.innerWidth, ... |
Read now
Unlock full access