Bonus #2: Flight Controls
Whereâs the fun in scattering a bunch of planets around if you canât fly through them, right?
Fly controls are much more complicated than they might seemâvery much more complex than the controls weâre building for our avatar. So weâll load in new controls instead of writing our own. All the way at the top of our code, add a new <script> tag to load in FlyControls.js.
â | <body></body> |
â | <script src=â"/three.js"â></script> |
» | <script src=â"/controls/FlyControls.js"â></script> |
Weâll talk more about loading code like that in Chapter 9, â Whatâs All That Other Code?â.
Loading the code is only half of the job. The other half is using it. To do that, add the following below the rColor() function, ...
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.