Skip to content

Please update your browser

Your browser version is not supported by this site. CS First may not work properly. Learn more

2. Talking Artwork

Transcript

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 animate a sprite, in this case the subject of a painting. Select a subject, or sprite, to animate. Each starter project contains sprites with multiple costumes. Go to the “looks” menu, and drag out a “next costume” block. Click on it a few times to see the sprite’s mouth move. 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 sprite opens and closes its mouth. Computer scientists rarely create perfect code the first time around. After writing code, they keep trying new things and testing them until the code does what they want it to. This example repeats 20 times, but you can use whatever number works for your project. So, the sprite’s mouth is moving, but it’s moving too fast to look like natural speaking. You solved a similar problem on Day 2. Just like you did that time, drag out a “wait” block.

Tinker with different lengths of time in the “wait” block. This example waits for .1 second, 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, and a “wait” block.

Tinker with the values in the “repeat” and “wait” blocks until you’re happy with your animation.

arrow_backward Back
Next arrow_forward
Instructions
  1. Animate the sprite using next costume, repeat and wait blocks.