Acknowledgments |
|
xiii | |
Introduction |
|
xv | |
|
1 Project: Creating Simple Shapes |
|
|
1 | (16) |
|
Programming with the 3DE Code Editor |
|
|
1 | (3) |
|
Making Shapes with JavaScript |
|
|
4 | (1) |
|
|
4 | (3) |
|
Making Boxes with the Cube Shape |
|
|
7 | (2) |
|
Using Cylinders for All Kinds of Shapes |
|
|
9 | (3) |
|
Building Flat Surfaces with Planes |
|
|
12 | (1) |
|
Rendering Donuts (Not the Kind You Eat) with Torus |
|
|
12 | (2) |
|
|
14 | (1) |
|
|
15 | (1) |
|
|
15 | (2) |
|
2 Debugging: Fixing Code When Things Go Wrong |
|
|
17 | (10) |
|
|
18 | (1) |
|
Debugging in 3DE: The Red X |
|
|
18 | (1) |
|
Debugging in 3DE: The Yellow Triangle |
|
|
19 | (1) |
|
Opening and Closing the JavaScript Console |
|
|
20 | (1) |
|
|
20 | (2) |
|
Common 3D Programming Errors |
|
|
22 | (2) |
|
Recovering When 3DE Is Broken |
|
|
24 | (1) |
|
|
25 | (2) |
|
3 Project: Making an Avatar |
|
|
27 | (12) |
|
|
28 | (1) |
|
|
28 | (1) |
|
Making a Whole from Parts |
|
|
29 | (1) |
|
|
30 | (2) |
|
|
32 | (2) |
|
Challenge: Make the Avatar Your Own |
|
|
34 | (1) |
|
|
34 | (3) |
|
|
37 | (1) |
|
|
37 | (2) |
|
4 Project: Moving Avatars |
|
|
39 | (14) |
|
|
39 | (1) |
|
Building Interactive Systems with Keyboard Events |
|
|
40 | (1) |
|
Converting Keyboard Events into Avatar Movement |
|
|
41 | (2) |
|
Challenge: Start/Stop Animation |
|
|
43 | (1) |
|
Building a Forest with Functions |
|
|
44 | (3) |
|
Moving the Camera with the Avatar |
|
|
47 | (4) |
|
|
51 | (1) |
|
|
52 | (1) |
|
5 Functions: Use and Use Again |
|
|
53 | (14) |
|
|
54 | (1) |
|
|
55 | (2) |
|
Functions that Return Values |
|
|
57 | (2) |
|
|
59 | (2) |
|
|
61 | (2) |
|
|
63 | (1) |
|
|
64 | (2) |
|
|
66 | (1) |
|
|
66 | (1) |
|
6 Project: Moving Hands and Feet |
|
|
67 | (10) |
|
|
67 | (1) |
|
|
67 | (4) |
|
Swinging Hands and Feet Together |
|
|
71 | (1) |
|
|
72 | (3) |
|
|
75 | (1) |
|
|
75 | (2) |
|
7 A Closer Look at JavaScript Fundamentals |
|
|
77 | (18) |
|
|
77 | (1) |
|
Describing Things in JavaScript |
|
|
78 | (3) |
|
Numbers, Words, and Other Things in JavaScript |
|
|
81 | (9) |
|
|
90 | (3) |
|
|
93 | (2) |
|
8 Project: Turning Our Avatar |
|
|
95 | (8) |
|
|
95 | (1) |
|
Facing the Proper Direction |
|
|
95 | (2) |
|
|
97 | (2) |
|
|
99 | (1) |
|
|
100 | (1) |
|
|
101 | (2) |
|
9 What's All That Other Code? |
|
|
103 | (8) |
|
|
103 | (1) |
|
A Quick Introduction to HTML |
|
|
103 | (2) |
|
|
105 | (1) |
|
Using Cameras to Capture the Scene |
|
|
106 | (1) |
|
Using a Renderer to Project What the Camera Sees |
|
|
106 | (1) |
|
Exploring Different Cameras |
|
|
107 | (2) |
|
|
109 | (2) |
|
|
111 | (6) |
|
|
112 | (1) |
|
|
112 | (4) |
|
|
116 | (1) |
|
|
116 | (1) |
|
|
117 | (12) |
|
|
118 | (1) |
|
Starting a Scoreboard at Zero |
|
|
118 | (1) |
|
Giving Trees a Little Wiggle |
|
|
119 | (3) |
|
|
122 | (2) |
|
Making Our Games Even Better |
|
|
124 | (3) |
|
|
127 | (1) |
|
|
127 | (2) |
|
12 Working with Lights and Materials |
|
|
129 | (14) |
|
|
129 | (2) |
|
|
131 | (1) |
|
|
132 | (1) |
|
|
132 | (2) |
|
|
134 | (2) |
|
|
136 | (3) |
|
|
139 | (1) |
|
|
140 | (1) |
|
|
141 | (1) |
|
|
142 | (1) |
|
13 Project: Phases of the Moon |
|
|
143 | (16) |
|
|
144 | (1) |
|
|
145 | (1) |
|
Game and Simulation Logic |
|
|
146 | (2) |
|
|
148 | (3) |
|
|
151 | (1) |
|
|
152 | (2) |
|
|
154 | (1) |
|
|
155 | (2) |
|
Not Perfect, But Still a Great Simulation |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
158 | (1) |
|
14 Project: The Purple Fruit Monster Game |
|
|
159 | (18) |
|
|
159 | (3) |
|
|
162 | (1) |
|
Adding Ground for the Game |
|
|
163 | (1) |
|
|
164 | (4) |
|
|
168 | (1) |
|
|
169 | (5) |
|
|
174 | (1) |
|
|
175 | (1) |
|
|
175 | (2) |
|
|
177 | (18) |
|
|
178 | (1) |
|
|
179 | (10) |
|
Bonus #1 Add a Background |
|
|
189 | (1) |
|
|
190 | (2) |
|
|
192 | (1) |
|
|
193 | (1) |
|
|
193 | (2) |
|
16 Learning about JavaScript Objects |
|
|
195 | (12) |
|
|
195 | (1) |
|
|
196 | (2) |
|
|
198 | (1) |
|
|
199 | (1) |
|
|
200 | (3) |
|
The Worst Thing in JavaScript: Losing this |
|
|
203 | (1) |
|
|
204 | (1) |
|
|
205 | (1) |
|
|
205 | (2) |
|
17 Project: Ready, Steady, Launch |
|
|
207 | (14) |
|
|
208 | (1) |
|
|
209 | (4) |
|
|
213 | (1) |
|
|
213 | (4) |
|
|
217 | (2) |
|
|
219 | (1) |
|
|
219 | (2) |
|
18 Project: Two-Player Games |
|
|
221 | (14) |
|
|
222 | (1) |
|
|
222 | (5) |
|
|
227 | (3) |
|
Teaching Baskets to Update the Correct Scoreboard |
|
|
230 | (1) |
|
|
231 | (2) |
|
|
233 | (1) |
|
|
234 | (1) |
|
|
234 | (1) |
|
|
235 | (26) |
|
|
235 | (2) |
|
Pushing and Pulling Shapes |
|
|
237 | (5) |
|
|
242 | (2) |
|
|
244 | (4) |
|
|
248 | (1) |
|
|
249 | (1) |
|
|
250 | (1) |
|
|
251 | (1) |
|
|
252 | (2) |
|
|
254 | (6) |
|
|
260 | (1) |
|
|
260 | (1) |
|
20 Getting Code on the Web |
|
|
261 | (10) |
|
The Mighty, Mighty Browser |
|
|
261 | (4) |
|
|
265 | (1) |
|
Putting Your Code on Another Site |
|
|
265 | (4) |
|
|
269 | (1) |
|
|
270 | (1) |
|
|
271 | (58) |
|
Code: Creating Simple Shapes |
|
|
271 | (2) |
|
Code: Playing with the Console and Finding What's Broken |
|
|
273 | (1) |
|
|
273 | (1) |
|
|
274 | (2) |
|
Code: Functions: Use and Use Again |
|
|
276 | (2) |
|
Code: Moving Hands and Feet |
|
|
278 | (3) |
|
Code: A Closer Look at JavaScript Fundamentals |
|
|
281 | (1) |
|
|
281 | (3) |
|
Code: What's All That Other Code? |
|
|
284 | (1) |
|
|
284 | (4) |
|
|
288 | (6) |
|
Code: Working with Lights and Materials |
|
|
294 | (2) |
|
|
296 | (3) |
|
Code: The Purple Fruit Monster Game |
|
|
299 | (4) |
|
|
303 | (4) |
|
Code: Learning about JavaScript Objects |
|
|
307 | (3) |
|
Code: Ready, Steady, Launch |
|
|
310 | (5) |
|
Code: Two-Player Ready, Steady, Launch |
|
|
315 | (6) |
|
|
321 | (5) |
|
Code: Getting Code on the Web |
|
|
326 | (3) |
|
A2 JavaScript Code Collections Used in This Book |
|
|
329 | (6) |
|
|
329 | (1) |
|
|
329 | (1) |
|
|
330 | (1) |
|
|
331 | (1) |
|
|
331 | (1) |
|
|
331 | (1) |
|
|
332 | (1) |
|
|
332 | (3) |
Bibliography |
|
335 | (2) |
Index |
|
337 | |