Interactive scenes



Now that we know how to make sweet animated scenes, let's make sure we can handle the other sort of non-static scene: scenes that respond to user interaction. For example, we want to draw a scene where Winston has babies (after his rock star phase, of course) -- but we also want to let the user click to give Winston MORE babies. Because we can always use more little Winstonitos in the world, right?

Here's what that scene would look like as a standalone program. The program draws the static part of the scene, and then in mouseClicked, it draws Winston baby images at the clicked mouse location, layering them on top of whatever was already drawn.