Loading...
Hello, my name is Mrs. Powell and welcome to Computing.
I'm so pleased that you decided to join me today.
In today's lesson, we are going to be learning how to programme more than one sprite and more than one background.
Let's get started.
Welcome to today's lesson from the unit Building sequences in programmes.
This lesson is called "Programming multiple sprites and multiple backgrounds." By the end of today's lesson, you'll be able to modify a design to create your own quiz questions.
We will be using these keywords throughout today's lesson.
The first word is quiz.
Quiz: a game where you answer questions to see if you are right.
The second word is background.
Background: the still picture on the stage in ScratchJr.
The third word is say block.
Say block: a command block that makes a sprite show words in a speech bubble.
Lesson outline: programming multiple sprites and backgrounds.
Today's lesson is split into two sections.
The first section we'll look at modifying a quiz design, and in the second section we'll be creating a quiz.
Let's get started with the first section, modifying a quiz design.
Modify a quiz design.
In this lesson, you'll create a quiz.
The quiz is called "Who lives here?" Let's take a look at this screenshot from ScratchJr.
What do you see here? Have you noticed that I've got two sprites? I've got a chicken sprite and a fish sprite.
I've also got two pages.
Sam's asked, "Where are the sprites?" Take a look at the screenshot and see if you can work out where the chicken and the fish are.
Jacob replies, "The sprites are underwater." Here in the screenshot, my chicken and my fish, they are on the underwater background.
Sam asks, "Which sprite lives here?" What do you think? Which sprite would live underwater in the ocean? Would a fish live underwater or would a chicken live underwater? Well done if you thought fish just like Jacob here.
Jacob says, "The fish!" I'd like you to watch the video demonstration of the "Who lives here?" quiz.
Let's watch it together.
<v Instructor>In this programme, when I click on the fish,</v> it would say "yes" to my answer and move me to the next page.
When I click on the chicken, the programme will stop.
<v ->Well done for watching that video all the way through.
</v> Which command blocks did you notice? Pause the video and take a look at the blocks.
Did you see the move left block, the move up block, the move down block, the move right block, or the turn block, the end block, the change page block, the grow block, the shrink block, the say block, the speed block, start on flag block, or start on tap block? You'll be using these command blocks to build your own quiz programme.
The say block, the start on tap block, the change page block, and the end block.
This design is used to create a quiz.
What do you see here? What do you notice in the design? We have a question, "Who lives here?" We also have two backgrounds, underwater and farm.
We have two sprites, a chicken and a fish.
Let's look at the quiz together more closely.
Which sprite would you expect to find in the sea? Do you think it's the chicken or the fish would live in the sea? Jacob says, "The fish!" Well done if you thought that.
When the fish is tapped on, it will say "yes" in a speech bubble and then the farm will be shown.
The fish lives in the sea, so it says "yes." When the chicken is tapped on, it will say "no" in a speech bubble and then the programme will stop.
The chicken doesn't live in the sea.
The quiz will repeat between the two pages.
It will stop if the player gets a question wrong.
Based on the original design, you'll now design your own quiz.
To get ready to make your own quiz, watch the quiz animation again.
<v Instructor>In this programme, when I click on the fish,</v> it would say "yes" to my answer and move me to the next page.
When I click on the chicken, the programme will stop.
<v ->Well done for watching the animation again.
</v> Your quiz will be a version of "Who lives here?" with your own sprites and backgrounds.
Which two backgrounds will you use? Choose two of these backgrounds.
You might want to choose the underwater background.
You might want to use the jungle background, or the savanna background.
Perhaps you'll choose the park background or the arctic tundra.
Or finally, you might want to use the space background.
Pause the video to choose your two backgrounds.
Your chosen backgrounds will go here in the design.
Here's Izzy, and Izzy says, "I chose the savanna and underwater backgrounds." She's placed them into her design.
Can you see them? Next, I'd like you to choose two sprites from these sprites.
One sprite should match your first background and the other sprite should match your second background.
So looking here, we have an elephant.
What kind of background would it match? I think it could match the savanna.
What about the giraffe? Which background could the giraffe match? I think that might also be in the savanna.
How about the starfish and the fish? They'd probably suit the underwater background.
We've got a lizard there.
Perhaps that could go in the jungle background, so could the frog.
We've got a dog there, that might be in the park background.
Have a little look at the sprites and see if you can find one to match your first background and one to match your second background.
Pause the video to choose your two sprites.
Fantastic.
You've chosen two sprites.
You're doing really well.
Your chosen sprites will go in these spaces.
I need your help.
Which one is not an example of a sprite? Pause the video and have a quick look.
Well done if you got A.
A is not an example of a sprite.
Why is that? The jungle is a background, not a sprite.
Well done for having a try.
This is Izzy's design.
Izzy says, "To match my backgrounds, I chose the elephant and starfish sprites." It looks like she chose the elephant to match the savanna background and the starfish to match the underwater background.
In your design, I'd like you to write tap and then the names of your sprite.
Here's Izzy, and Izzy says, "I wrote the names of my sprites here." I can see that Izzy has written tap elephant, tap starfish.
Well done.
You've done really well.
You've gotten this far in the design and we've almost gotten to the end.
I want you to have a think now, will the sprite say "yes" or "no" when it is tapped on? Remember the question.
So the question is, who lives here? The elephant says "yes" in the savanna background, and the starfish says "no" in the savanna background.
In the underwater background, who lives here? The elephant says "no", and the starfish says "yes".
We're at step three now and we have to think, will our programme stop or change to the other background depending on the sprite we are using? What do you think? Will the programme stop or change to a different background? Here's Izzy, and this is what Izzy thinks.
"I thought about what should happen in my programme." Let's think about it a little bit more deeply.
True or false? If a sprite answers the question with "no", then the programme should stop.
Pause the video to have a think.
The answer is true.
Why is that? If the player gets the question wrong, then the quiz stops.
That means if a sprite answers the question with "no," then the quiz will stop.
Well done for having a try.
Izzy says, "If the sprite says 'no,' I want the programme to stop." The starfish does not live in the savanna, and the elephant does not live underwater.
So the programme will stop when they say "no." Izzy says, "If the sprite says 'yes,' I want the programme to change to the other page." Can you see, Izzy has added in change to underwater background and she's done that for the elephant? And she's also said, change to savanna background, and she's done that for the starfish.
Well done.
That was really good listening.
I'd now like you to try and complete your design.
Pause the video to finish your design.
Well done for having a try.
Watch the video to review the quiz design.
<v Instructor>Let's go through the answers</v> for this part of the task.
We are looking at the design for our quiz programme.
So first things first, we have got the questions, who lives here? I'm going to do the first page first, so that's the top row.
The background I've chosen is the savanna background and the sprites I've got are the elephant and the starfish.
Remember, you want one sprite that belongs there and one that doesn't.
For step one, start on tap, I have tap elephant and then tap starfish.
That will start the code.
For step two, if I tap on the elephant, it's going to say "yes," but if I tap on the starfish, it's going to say "no." And then for step three, it's either going to stop the programme or change to the other background.
So for the elephant, it is going to change to the underwater background, and for the starfish, the programme will stop.
Let's look at the second page, which will be the underwater background.
I'm going to use the same sprites.
I'm going to also have the same commands here, so tap on the elephant to start and tap on the starfish to start.
When I tap on the elephant this time to answer the question, "Who lives here?", the elephant will say "no," but the starfish will say "yes." And then in step three, where the programme will stop or it will change to the other background, if I tap on the elephant, it will say "no" and the programme will stop.
But if I tap on the starfish, it will say "yes" and change back to the savanna background.
<v ->Well done.
</v> You've done so well and you've completed the first section, modify a quiz design.
Let's move on to the second section and create our quiz now in ScratchJr.
I can't wait to try this.
Create a quiz.
With your completed design, you're now ready to create your quiz in ScratchJr.
First, you'll add your pages and backgrounds.
I need some help.
How do you add a new page? I've forgotten.
Pause the video and have a quick think.
Well done.
You use the right plus button to add a new page.
Can you see it there? Next, you'll add your two sprites.
Make sure you add them to both pages.
Uh oh, this elephant sprite is far too big.
If a sprite is too big or small, you can use the grow or shrink command blocks to change their size.
Remember to move the command block into the programming area to use it.
Which button is used to add a new page? Is it A, B, or C? Pause the video and have a guess.
Well done.
Did you get B? B is the button used to add a new page.
To add another sprite, use the plus button in the left menu.
Can you see, I've got one sprite at the moment, the elephant sprite, but do you remember I need another sprite? That's right, I need the starfish sprite as well.
I'm going to use the plus button in the left menu.
To select another sprite, tap on it in the left menu.
I'm going to tap on the starfish.
How can you tell which sprite you have selected? If you have a look at my screenshot, how can you tell which sprite is selected? Is it the elephant sprite or is it the starfish sprite? What clues do we have here that let us know? Pause the video and have a think.
The sprite is highlighted in the left menu.
I can see that the starfish is highlighted in the left menu.
The sprite's outline is shown in the programming area.
Can you see that? There's a grey outline of a starfish.
The sprite also has a white outline on the stage.
Can you see that the starfish has a white outline but the elephant doesn't? I've got a question here for you.
What is this block called? Do you think it is A, speech; B, say; or C, shout? Did you get B, say? Well done for having a try.
What will this programme do? Let's take a little look at the blocks that we see here.
How many blocks do you see? I can see three.
That first one looks like start on tap, the second one looks like a say block, and the last one looks like a change page block.
I wonder what this programme will do when run.
Pause the video and have a quick think.
When the sprite is tapped, It will say "yes" in a speech bubble, then the page will change to page two.
What will this programme do? I've got three more command blocks.
When the programme is run, what do you think it will do? Pause the video and see if you can work it out.
When the sprite is tapped, it will say "no" in a speech bubble, then the programme will stop.
Is that what you thought? Well done for having a look.
Now I'd like you to check your plan to see which sprites need which programme.
Let's have a little look here at my plan.
Firstly, I've got the savanna background and I've got the elephant sprite and the starfish sprite.
Let's look at the elephant sprite and think about which blocks I need to programme it.
Step one, start on tap.
So I need to have the start on tap block for the elephant.
Step two, I need say "yes." So I need the say block and I need my elephant to say "yes." I can type that in.
Then for step three, I need the change page block so that I can change to the underwater background.
Those are the three blocks that I'll need for my elephant sprite.
Let's have a little look at the starfish sprite for the savanna background.
I need my starfish to start on tap.
That's my first block.
My second block I need is the say block, and I want my starfish to say "no." My third block will be to stop the programme, so that will be the end block.
So I'll need those three blocks for the starfish.
Start on tap, say "no," and end.
Let's have a little look at the underwater background and think about what kind of blocks I'll need to programme my sprites.
I've got the elephant sprite.
Step one is start on tap.
So I need the start on tap block for the elephant.
Step two is say "no." I need the say block to do that.
And the third is to stop the programme, so I need the end block.
Those are the three blocks I need for my elephant sprite.
Let's have a think about the starfish in the underwater background.
The first step is tap on starfish.
The second step is the say block say "yes," and the third step is to change page to the savanna background.
Those are the blocks that I need to programme the starfish in the underwater background.
Use your design to help you create your quiz.
Your quiz must have two pages, two backgrounds, two sprites on each background.
And can you see here the blocks that you'll need to use? Pause the video so that you can create your quiz in ScratchJr.
Well done.
I think you've done so well making your own quiz.
Let's watch the video to review the making of the "Who lives here?" quiz.
<v Instructor>In this task, we have to use our design</v> to create our "Who lives here?" quiz in ScratchJr.
The first step is to add the backgrounds.
So to add a background, we're going to go up to the background button and scroll down to find the two that you would like to use.
So the first one, I'm going to choose savanna.
And then we need to add a new page.
And then add our next backdrop.
So I'm going to get the underwater one.
There we go.
I've got my two backdrops.
Next, I'm going to add the sprites.
So the first sprite is the elephant sprite.
Let's go back to page one and just scroll down to find the elephant.
The elephant comes quite large, so you can use the shrink button here.
You pull it down, tap on it two times.
I think it makes it a good size for the quiz.
And then the other sprite is going to be get the starfish.
Pull it in.
Maybe I want my starfish to be a bit larger to match the elephant, so I'm going to make that larger just a little bit.
Let's do the same on page two.
Get my sprites.
First sprite is the elephant.
Next sprite, starfish.
Now we've got our sprites and our backgrounds, we're going to do some programming.
So back on page one, let's go to the elephant first.
Elephant's going to have a start on tap button here.
Let's use that command block.
And when I tap on the elephant, the elephant is going to say something.
Using my plan, I can check the elephant is going to say "yes." And then after that, there's going to be the change page button.
So in this red menu you can see there's a new block here, go to page.
We're going to use that to turn over to the underwater environment when we press on the elephant.
Let's check the starfish's code.
Starfish is also going to start on tap and the starfish is going to say, remember, the question is, who lives here? If I tap on the starfish, the starfish is going to say "no," and then after that, the programme will stop.
So I need to go into the end blocks here.
There we go.
Let's look at page two's programming.
We've got our elephant at the top.
Same as before, start on tap, say.
And let's check this first.
By looking at my plan in the underwater page, if I tap on the elephant, the elephant is going to say "no" because the elephant doesn't live here and it's going to end with an end block.
On the starfish though is where we get this other new block go to page.
So the starfish uses the start on tap, then a say.
What's the starfish going to say? "Yes." And then the block from before, the go to page, is going to come into place here.
So let's see what's going on in this programme.
We're going to test it to see that all our programme blocks are working correctly.
So I'm going to press the full screen here to make this a bit larger.
Let's test out our programme.
I'm going to select every sprite to check all the programmes are working.
The first question is, who lives here? So if I press on the elephant, it should take me to the next page.
Let's press on the elephant now.
It says "yes" and changes to the new page.
That's great.
On this page I can say "Who lives here?" and the answer should be the starfish.
The starfish should say "yes" and take me back.
There we go.
Now on this page, if I press this starfish as my answer, the starfish should say "no" and the programme would end.
That's great.
Let's go back to the underwater page.
If the question is "Who lives here?" and I press on the elephant, the elephant should say "no" and the programme will end.
That's it.
My quiz is finished.
All the programmes I've added work correctly.
<v ->Fantastic.
You've gotten to the end of today's lesson.
</v> Let's summarise.
A design can be modified to create a new project.
Backgrounds and characters can be chosen to match the design.
A sequence of blocks can be used to create a quiz.
The say block is a command block that makes a sprite show words in a speech bubble.
Event blocks, like start on tap and start on green flag, trigger specific actions.
Each sprite must be selected to add commands specific to that sprite.
That brings us to the end of today's lesson.
You've done really well.