July 2018
Beginner to intermediate
374 pages
8h 54m
English
In addition to lights, this game will have a ball, a game board, and a goal. Let’s start with the following code outline, including the double slashes:
| | //var lights = addLights(); |
| | //var ball = addBall(); |
| | //var board = addBoard(); |
| | //var goal = addGoal(); |
Just as we did in Chapter 14, Project: The Purple Fruit Monster Game, we’ll uncomment these function calls as we define the functions.
Before doing anything else, let’s add some lights to the scene.
Below the commented-out code outline, add the following function definition of addLights:
| | function addLights() { |
| | var lights = new THREE.Object3D(); |
| | |
| | var light1 = new THREE.PointLight('white', 0.4); |
| | light1.position.set(50, 50, -100); |
| |
Read now
Unlock full access