In this video, you will animate the mouth of a character from a painting.
Just like the project you made on Day 2, today’s project will use “next costume” to animatea sprite, in this case the subject of a painting. Select a subject, or sprite, to animate. Eachstarter project contains sprites with multiple costumes. Go to the “looks” menu, anddrag out a “next costume” block. Click on it a few times to see the sprite’s mouthmove. It works! You’ll get pretty tired of clicking“next costume” over and over to make it look like the sprite is talking, though.
To make something repeat a specified number of times, use the “repeat” loop.
Go to the control menu and drag the “repeat” loop around the “next costume” block.
Click on the block stack to test it. The sprite’s mouth opens and closes 10 times, then stops.
Tinker with the number in the “repeat” loop to vary the number of times the spriteopens and closes its mouth. Computer scientists rarely create perfect code the first timearound. After writing code, they keep trying new things and testing them until the codedoes what they want it to. This example repeats 20 times, but you can use whatever numberworks for your project. So, the sprite’s mouth is moving, but it’smoving too fast to look like natural speaking. You solved a similar problem on Day 2. Justlike you did that time, drag out a “wait” block.
Tinker with different lengths of time in the “wait” block. This example waits for .1second, but you can use any time that works for you.
Now, it’s your turn: Animate your sprite using:a “next costume” block, a “repeat” block, anda “wait” block.
Tinker with the values in the “repeat” and “wait” blocks until you’re happywith your animation.