Change Mars into the Moon

The first thing we need to do is rename every instance of mars to moon. Do this before anything else and be sure that no mars variables remain (there should be six changes).

Once you’ve done this, you’ll still have a red planet revolving around the sun. Naming it differently doesn’t change how it looks or behaves—we’ll need to change our code for that.

This is an important first step. We didn’t try to change everything, just the name of one thing in our code. Once everything is behaving as before, we’re ready for the next step. Never try to change everything at once—you’ll almost always end up breaking everything. The worst thing that we could have done with our first step is make the animation disappear because we ...

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.