Loading...
Hello, my name's Ms. Powell and welcome to Computing.
I'm so pleased that you decided to join me here today.
In today's lesson, we're going to be looking at animating our own name in Scratch.
Let's get started.
Welcome to today's lesson from the unit, Using repetition and programming to create a game.
This lesson is called Animating Text, and by the end of today's lesson you will be able to develop a design that includes two or more loops.
We'll be using these keywords throughout today's lesson.
Let's take a look at them.
The first word is animate.
Animate: this means to make something move or change its appearance.
The second word is algorithm.
Algorithm: This is a precise sequence of steps that can be followed to do a task.
The third word is duplicate.
Duplicate: This means to copy something exactly, such as a part of a coding project.
And the last word is evaluate.
Evaluate: This means to look at something carefully and decide how well it works or how it could be improved.
Lesson outline, Animating text.
This lesson is split into two sections.
In the first section, we'll design a name animation, and in the second section, we'll evaluate a name animation.
Let's get started with the first section, Design a name animation.
Design a name animation.
What will this sprite do? Make a prediction and watch the animation on the next slide to see what happens.
I'd like you to take a little look at the blocks here from Scratch.
See if you can work out what will happen to the sprite.
The first block is a repeat block with a value of five.
The second block is turn right 45 degrees clockwise.
The third block is wait one second, the fourth block is turn left 45 degrees anti-clockwise.
The fifth block is wait one second, and the sixth block is next costume.
If you read through that code, just like you would read a sentence, what actions do you think the sprite will take? Pause the video and have a try.
Watch the animation.
The sprite is turning and changing its costume.
This is repeating five times.
So looking at the code here in Scratch, we have repeat five.
So the programme will run for five times.
It's a count controlled loop.
The sprite is turning 45 degrees to the right, clockwise, waiting a second and then turning the other way, 45 degrees anti-clockwise, waiting a second and then changing its appearance with next costume.
This happens five times.
So it looks as if our sprite is dancing.
Well done.
In this lesson, you will animate the letters of your name in Scratch.
This is an example of an animated name project.
Watch it closely.
What parts of this animation repeat? What parts happen at the same time? Pause the video and have a quick look at the name.
See if you can answer those questions.
In Scratch, there are sprites called story letters.
The story letters have three different costumes.
You will use code to switch between the costumes and repeat.
Use the same event like clicking the green flag to start all of your animations at the same time.
This is called simultaneous animation.
If you see here on the left, I've got one of my story letters.
It's letter J.
Letter J has three different appearances.
We have a green letter, J, an orange and white letter J and a blue letter J.
These are called costumes.
I can use my code to change between the costumes and it will look as if the letter J's appearance is changing.
First you'll write a plan, a plan can help you to think about what you want to include in your programme.
Think about your letter sprites.
Your sprites could turn left or right, change costume, move, rotate, or get bigger or smaller.
This is the design sheet.
I'd like you to fill in the table.
We have sprite name, sprite movement, sprite actions, type of repetition used: infinite, forever or count controlled, and your algorithm, which is the steps that you will take.
written out here in your plan.
This is Lucas, and Lucas says, "What is the sprite name?" Jun says, "This is the letter that you will animate.
I'll record my first choice as the 'story letter J'." So here's my sprite name, story letter J.
That's the first letter that I'm planning on animating in the name Jun.
Alex asks, "What about sprite movement?" Aisha says, "Your sprite can move, turn, point in different directions or even glide." So for letter J, I'd like my sprite movement to be left, move left and right.
Well done.
Super listening.
Lucas asks, "Are there other actions?" Jun says, "Your sprite letter can change costume to change colour.
Maybe you have other ideas too." So for my story letter J, it's going to move left and right and the actions will be change what it looks like.
So I'll use a costume change to do that.
Well done.
Do you remember, a count controlled loop repeats a fixed number of times and an infinite loop repeats without stopping.
Choosing the right loop will depend on your plan for your letter sprite.
Can you see the two blocks here in Scratch? I've got the forever loop here and it says forever in it.
All of the blocks that go inside of the forever block will keep repeating continuously until the programme is stopped.
I've also got my count-controlled loop.
It says repeat and I put a value.
I can put a value inside the white circle.
All the blocks inside of the repeat block will repeat for a set number of times and I get to choose that number there in the white circle.
I need your help.
You're doing so well listening.
I've got some missing words here, and I'd like you to fill in the blanks: An blank that never stops uses an blank loop.
An animation that repeats for a set number of times uses a blank loop." Use the words in the box: count-controlled, infinite, and animation; and use those to fill in the blanks.
Pause the video and have a try.
Well done for giving that a go.
Let's have a look at the answers.
"An animation that never stops uses an infinite loop.
An animation that repeats for a set number of times uses a count-controlled loop." Fill in which type of repetition your sprite will use.
So for my story letter J, I would like my repetition to be infinite.
That means it will keep repeating forever and ever until the programme is stopped.
Alex asks, "What is an algorithm?" Aisha says, "An algorithm is a precise sequence of steps that can be followed to do a task." You will record your steps for your animated letter in an algorithm.
Each letter will be a different sprite.
For each letter, think about how you want it to move, when it will change its costume, what kind of repetition will be used.
Finally, record your algorithm for that sprite.
So here for my story letter J, I want it to move left and right and change what it looks like, and I'll have that as an infinite loop.
It will run forever.
My algorithm explains the steps.
When you start the programme: repeat infinitely: change to next costume, move right 20 steps and wait for one second, move left 20 steps and wait for one second.
These are the commands to run my programme.
Each letter sprite will have its own column on the plan.
I've got a question here for you.
I'd like you to give it a try.
What block would you use if you wanted your sprite to spin infinitely? Is it A: wait x seconds? Is it B: move x steps? Is it C: repeat x times loop? Or is it D: forever loop? Pause the video whilst you have a quick think.
Which block would you use if you wanted your sprite to spin infinitely? The answer is D, the forever loop, and this is what it looks like here in Scratch.
Well done for having a go.
I have a task here for you.
I'd like you to choose at least three letters to animate in your name.
For each sprite, record: the sprite name, sprite movement, sprite actions, type of repetition, and an algorithm.
Complete the design sheet for each sprite.
So that means for each letter, Pause the video to finish the task.
I'd like to give you some feedback.
So here is a design sheet example.
We've got sprite name, story letter, J, sprite movement, move left and right, sprite actions, change what it looks like.
Type of repetition used, infinite, forever.
Algorithm, when you start the programme, repeatedly: change to next costume, move right 20 steps and wait for one second, move left 20 steps and wait for one second.
This is for my letter J, but I will need to complete the sheets for my other letters.
Fantastic, you've done so well in the first section, Design a name animation.
Let's move on to the second section, Evaluate a name animation.
The costume of a sprite changes what it looks like.
Let's look at the blocks here in Scratch.
It says, when green flag clicked, and next costume.
The sprite is blue in one costume and orange in the other.
To add a letter sprite: Number one, hover over the cat button.
Number two, select the cat button to open the library.
Number three, select letters to narrow down the search.
Select the story letter sprites.
You can see here some of the letters have got story for them: Story A, Story B.
We want the story letter sprites.
To change the sprite size, change this value.
So here for story J, I can change the size here in the box and I've got 100.
Think about how you want your animation to start.
All of the sprites should start in the same way, so they can all animate simultaneously.
That means animate together.
Will you use a green flag or a different event? So here are some ways that we could start our programme.
We've got when green flag clicked or when space key pressed.
However, you might find another way.
Add the first story letter and programme it to loop through the costumes.
Remember to look back at your design to see what you need to programme.
Think carefully about the sequence of when you want actions to happen and the repetition, how the code will repeat.
Make sure each sequence of code starts with an event and uses repetition to make your letter animate.
So let's have a little look here at the code, here in Scratch, I've got when green flag clicked.
I have the forever loop, so that's going to keep running infinitely until the programme is stopped.
Change costume and wait 0.
5 seconds.
You can see here on the left, the letter J is changing its appearance continuously.
And for each appearance change, that lasts for 0.
5 seconds.
It looks like it is flashing.
The wait block adds a pause so that the costume change can be clearly seen.
If I didn't have a pause, it'd be a little bit too fast and I wouldn't be able to see the different colours.
There's my wait, 0.
5 seconds.
What would happen if you did not use a loop in this programme? Let's imagine it looked like this: When green flag is clicked, next costume, wait 0.
5 seconds.
What would happen? Pause the video and have a quick think.
How would the programme be different? That's right.
It would only move or change once.
What would happen if you did not use a wait block in this programme? Let's imagine the code looked like this: when green flag clicked, forever, and next costume.
There's no wait block here.
How do you think that will appear? Pause the video and have a quick think.
Well done for having a go.
The costume change would happen too quickly.
It would be difficult to see properly.
This is Jun.
Jun says, "I've coded one sprite and I'll reuse some parts of the coding sequence in my next animation." Aisha says, "You could duplicate your coding sequence to save time." Duplicating means to copy exactly.
You can duplicate code or even duplicate sprites and their attached code.
Be sure to test your code and make sure it works correctly before you duplicate it.
When you duplicate a code sequence, it creates an exact copy.
To duplicate your code onto a new sprite, drag the code sequence down on the top of the new sprite in the menu.
You can then change the copied code, like adjusting the movement and wait times, to animate your sprite in a new way.
Duplicating is great.
It helps you save time while you're making a programme.
Well done.
That's super listening.
Once all of your sprites have been coded, change the backdrop of your project.
To open the backdrops menu, select this box on the stage menu on the right.
Can you see it there? It says Stage.
Open the backdrops tab in the top left.
Can you see it there? It says backdrops.
And there's a paintbrush.
The backdrops menu will let you design your own backdrop.
Here I've got a canvas which I can use to decorate.
I can use the tools here like the paintbrush or the fill bucket to create my own backdrop.
Once your programme is completed, it is time to evaluate your work.
When you evaluate something, look at it carefully and decide how well it works or how it could be improved.
Lucas says, "Evaluating can help you think about how well your animation works and if the loops were effective." "It also helps you think of ways to improve your project for next time." Task B, evaluate a name animation.
Number one, code your animation in Scratch, based on your design.
Your sprite should animate using loops.
Number two, test and adjust the timing using wait blocks.
Change the background colour of your animation.
Pause the video so you can finish the task.
I'd like you to use your design to now animate your name.
This is the link to an example project: oak.
link/name If you click on the, you'll be able to see all of the codes that are used in the programme.
Well done.
You've done fantastically, animating your name.
I'd like you to now evaluate your work.
Tick the boxes to show if your animation had: at least three story style letter sprites; a loop for every sprite; letters that use a start event for the animation; and letters that change costumes as they animate.
Pause the video and tick the boxes if you had that in your animation.
Number three: did you use count-controlled or infinite forever loops? Explain your choice.
Number four: which action did you put inside the loops? Pause the video to finish the task.
I'd like to give you some feedback.
Did you use count-controlled or infinite forever loops? Explain your choice.
I used infinite loops because I wanted the letters to keep moving and changing costumes until I stopped the programme.
Number four: which actions did you put inside the loops? I used next costume and wait blocks to make the letters change colour and turn blocks to make them spin.
Number five: which event block did you use to start the animation playing? Number six: how successful do you feel the animation is? Is there anything you would improve? Pause the video and have a quick think about these questions.
I'd like to give you some feedback.
Number five: which event block did you use to start the animation playing? I used the when green flag clicked block, so all the letters would start animating at the same time.
Number six: how successful do you feel the animation is? Is there anything you would improve? I think the animation worked well because all my letters moved and looped how I planned.
I'd like to add more actions to each letter and try using a count-controlled loop for a letter.
Wow, you've done so well animating your name.
I bet they look amazing.
Let's summarise Animating text.
Repetition can be used to animate sprites.
You can apply both infinite loops and count-controlled loops to control how actions are repeated.
Animation follows an algorithm with each sprite running its own sequence of instructions.
The duplicate function in Scratch can be used to copy and adapt code blocks between sprites, which can save time.
Afterwards, it is good practise to evaluate your project to see what worked well and what can be improved.
Well done and that brings us to the end of today's lesson.