Our little man looks a bit lonely dancing by himself, doesn't he? Wouldn't it be nice if you could join in with the dancing? In this section, we will add buttons to the animation, to allow a user to change the dance moves that the stick man is doing.
In order to make the animation interactive, you're going to have to take the existing animation and split it up into its individual dance moves. There's a trick here: each dance move is exactly a second long. That means that the first 12
frames are the dance-left animation, the second 12
frames are the dance-right animation, and the final 12
define the jump animation.
We will make two new animations from the existing animation, one for dancing left and one for dancing right. The user interactions will be handled by changing which animation we are showing to the user.
Sounds simple? Let's go!
1. Open up the
Funky Stick Man
project you made in the first part of this chapter. Did you skip through...