Outline the Game

We’ll need the following in our game: a ball, a game board, a goal, lights, and a space background. As usual, we’ll also need to animate the game and we’ll have a separate function for game logic that doesn’t need to happen as often as animation. Type in the following code outline, including the double slashes.

 
//addLights();
 
//var ball = addBall();
 
//var board = addBoard();
 
 
//addControls();
 
//addGoal();
 
//addBackground();
 
//animate();
 
//gameStep();

Just as we did in Chapter 15, Project: The Purple Fruit Monster Game, we’ll uncomment these function calls as we define the functions.

Add Lights

Before doing anything else, let’s add some lights to the scene. Without lights, the rest of the stuff in our ...

Get 3D Game Programming for Kids 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.