Code: The Purple Fruit Monster Game
This is the final version of the game code from Chapter 14, âProject: The Purple Fruit Monster Gameâ:
â | <body></body> |
â | <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(); |
â | scene.setGravity(ânewâ THREE.Vector3( 0, -250, 0 )); |
â | âvarâ flat = {flatShading: âtrueâ}; |
â | âvarâ light = ânewâ THREE.AmbientLight(â'white'â, 0.8); |
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.