11 MOTION
Let the fun begin! I suspect many of you have been waiting patiently (or not so patiently) for this chapter. It took a certain restraint on my part to not start flying pixels around the screen back in Chapter 1. Animation and motion design is usually what gets my students hooked on coding—and even to embrace trigonometry. This chapter, we'll explore all kinds of neat motion (including some trig), from deflecting to bouncing to easing to springing. You'll even create an asteroid shower and learn how to code all sorts of interesting collisions.
Before we dive right into the code, though, I want to discuss very briefly how computer animation works in general, and also some different strategies employed to implement it.
Animation basics ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access