July 2018
Beginner to intermediate
374 pages
8h 54m
English
Functions are very powerful tools for JavaScript programmers. We saw two good uses for functions. Over-and-over functions like makePlanet() save a lot of coding. Calculating values like the random r() function also helps to make our coding lives easier. We even saw that the animate() function we’ve been using everywhere is a kind of tells-a-story function. It tells the story of animation in our games.
Most importantly though, we put all of these together to build a cool little universe. And we’re still just scratching the surface!
As you’ll see shortly, we’ll use functions a lot in the upcoming chapters. Let’s get started in the next chapter as we teach our avatar how to move its hands and feet!
Read now
Unlock full access