In the last unit, we saw an animation of a birthday card. We'll now create our own card, making it interactive. We want to create a card that looks like this. There are two characters, a butterfly and a cake. The butterfly is animated, and it looks like it's flying. When the program starts, the butterfly first says hello, it asks how old you are, it then repeats your answer and congratulates you for your birthday, and it finally invites you to blow the candles. The birthday cake has candles which are initially lit. The idea is that you blow in the microphone, blowing out the candles. There are quite a few things to program here. So, we'll break this program into smaller parts, which we'll tackle one after the other. Let's look at the behavior of the butterfly. There are two important aspects. First, it interacts with the user to ask a question, repeat his or her answer, and say a few more things. Second, it is flying during the entire program. I've named these two aspects, butterfly dialogue and flying butterfly, respectively. Now, let's have a look at the birthday cake. It's candles are initially lit, and it stays like this until the user blows in the microphone, at which point the candles are blown. I'll call the cake part of the program, cake candles. Now let's build a program for the interactive animated birthday card. In a new project, we'll add the two characters. We'll first delete the cat, then, we'll introduce the cake, and the butterfly, from the library. Note that the cake has two costumes, one with the candles lit, which we'll name lit, and one with the candles blown, which we'll name blown. The butterfly also has two costumes with different wing positions. We'll first tackle the butterfly data part of our program. It starts with a green flag and then it says, hello. So, we'll use a save block for this. In order to interact with the user, we'll use a block that has precisely this purpose. Within the Sensing palette, we'll choose the ask and wait block, putting in the butterfly's question. This block allows us to set a question to the user and it waits until the user answers by entering his or her age and pressing Enter. Once this value's entered, it is assigned to another block of the same group of Sensing, called Answer. The butterfly will then repeat the user's answer. So we'll move the answer block, inside a say block, and add it to our stack of code. Finally, it will say congratulations, and invite the user to blow out the candles. Let's test our code so far. Excellent. We'll now tackle the flying butterfly part of our program to add animation to the butterfly. We want it to be moving all the time, a few steps forwards and backwards while changing its costume. This way, the flying effect is more convincing. So, we'll use a move block and a switch costume block. We'll also make sure that there is a short pause between each move, with the use of the wait block. So we've got the code for the butterfly to move forwards, we'll now duplicate this code and modify it for its movement backwards. Let's hit the green flag again to see if it works. And it does, great! The code for the behavior of the butterfly is now ready. In the next video, we'll tackle the cake candles part of our program.