Lesson video

In progress...

Loading...

Hello, my name's Ms. Powell and welcome to Computing.

I'm so pleased that you decided to join me today.

In today's lesson, we're going to be learning how to start programmes of event blocks.

Let's jump straight in.

Welcome to today's lesson in the unit "Building sequences in programmes." This lesson is called "Building blocks to create a sequence." By the end of today's lesson, you'll be able to create a programme that uses event blocks.

We'll be using these keywords throughout today's lesson.

Let's have a look at them.

The first word is event.

Event.

This means the action that triggers a programme to start.

The second word is sprite.

Sprite.

An object that can be controlled by a programme.

The third word is algorithm.

Algorithm.

A precise set of ordered steps that a human or computer can follow to complete a task.

This lesson is split into two sections.

In the first section, we'll be learning to create sequences using different event blocks.

And in the second section, we'll create an animation of the seasons.

Let's get started with the first section.

Creating sequences using different event blocks.

In this lesson, you will create an animation in ScratchJr.

To do this, we will revise the ScratchJr command blocks and learn some new ones.

These are some ScratchJr command blocks.

I've got 10 command blocks here on the page.

Do you know what each one does? Have a look at them and see if you can remember what they do.

Pause the video to have a think.

Well done.

Did you get some of them right? Let's go through them together.

Number one is the move up block.

Number two is the move down block.

Number three is the move left block.

And number four is the move right block.

Number five is the turn right block.

Number six is the start block.

Number seven is the shrink block.

Number eight is the grow block.

Number nine is the speed block.

And number 10 is the end block.

Well done for having a try.

I've got a task here for you.

I'd like you to watch this video about the speed block.

<v Instructor>In this video,</v> I'm going to demonstrate the set speed block.

It's an orange block.

And you can see in my programme, you put the speed block before your movement block so that it can affect that movement.

So the speed block has got three different speeds.

It's got slow, medium, and fast.

So you can click on the arrow, like I did, to get this menu.

This tac character's got slow speed, the chicken has got medium speed, and the crab has got fast speed.

So let's have a race with these sprites and see which one will win.

I'm going to press the green flag now.

<v ->Can you help me?</v> I'm wondering what the grow block is.

Do you think it is A, B, or C? Pause the video and have a guess.

Well done if you got C.

C is the grow block.

Create sequences using different event blocks.

I'd like you to watch another video.

The green flag starts programmes.

There are other ways to start a programme.

The blocks that start a programme are called event blocks.

Can you see here the event blocks? In ScratchJr, they're yellow.

Event blocks are the actions that trigger programmes to start.

The sequence from before was tap chicken.

Chicken says "hi." I've got three event blocks here.

Which one do you think will start the programme when someone taps on the sprite? Pause the video and have a look at the blocks.

Well done.

Did you think it was number two? It does look a little bit like a hand tapping on a sprite.

The command blocks used are start on tap.

Say "hi." To change what the sprite says, tap on the text.

I need your help.

Start and start on tap are event blocks.

What colour are event blocks? I wonder, are they A, blue? B, yellow? Or C, red? Pause the video and have a think.

Well done for having a try.

Did you get B, yellow? The yellow blocks are event blocks.

Did you know each sprite can have its own event block? Can you see here I've got two sprites? I've got a chicken sprite and I also have a penguin sprite.

Both the chicken and the penguin can have their own event blocks.

To change another sprite, tap on the sprite you want in the left menu.

How can you tell which sprite you have selected? Looking at the picture, which sprite's selected? Is it the chicken sprite, or the penguin sprite? How can I tell? Are there any clues here? Pause the video and have a look.

Well, there are a few clues.

The sprite is highlighted in the left menu.

The sprite's outline is shown in the programming area.

Down at the bottom, can you see the grey outline? The sprite also has a white outline on the stage.

Can you see the penguin has a white outline but the chicken doesn't? Well done.

You're doing really well.

I've got a task here for you.

I'd like you to create a programme of your choice.

Your programme can have any background and must have two different sprites.

One sprite must use the start on tap event block, and the other must use the green flag event block.

Make sure you test that all of your programme works.

Tap the green flag and tap the sprite to trigger the start on the tap block.

Have a watch.

<v Instructor>In this video,</v> we are going to be creating a programme with two sprites.

So the first things first is to choose the backdrop.

I'm going to choose the stage today.

The one that looks like it's a theatre.

I'm going to tap on it, and then tap on the blue tick to put it in my programme.

Next, I see these two spotlights, so I'm going to add a sprite to each of them.

So I'm going to go up to the blue plus symbol on the left.

I'm going to tap on the chicken and then tap on the tick.

Move the chicken where I want it.

And then for my second sprite, I'm thinking that I want to put another character in.

Going to scroll down here.

Going to choose the frog.

Tick to put the frog in my programme, and move it along.

Okay, now each of these sprites can show you when they are selected.

So the chicken is selected now.

You can see the chicken has got a white outline.

And then down at the bottom, there is an outline, like a black-and-white version of that chicken down in the programming area.

And the same will be for the frog.

So when I tap on the frog now, you can see the white outline and the black-and-white frog as well.

So that helps you know which sprite you have got selected.

For the chicken sprite, I need to choose an event block.

So I could choose the start on green flag, or I could choose the start on tap.

I'm going to use the green flag for the chicken.

And I want the chicken to turn around, so I'm going to use move right.

I'm going to change the value to get the chicken to move more.

So 12 will get it to spin all the way around.

Going to finish with a red end block.

On the frog, the frog is going to use the other event block, which is the start on tap.

I'm going to drag that down to the frog.

And then for my movement block, I'm thinking frogs hop.

So I'm going to add a hop block onto the frog.

I think I want the frog to hop three times, so let's get three hops.

The value of two at the bottom for hop is not how many times, but it's how high the jump is.

That's why I've left it at two.

And then I'm going to finish with a red end block.

So let's test this programme.

The chicken code will start on the green flag.

So let's see if that works.

I'm going to go up to the green flag at the top.

Great, and when I tap on the frog, the frog's programme should run.

Great.

Let's test this programme in full screen.

So this white box up here is the full-screen button.

If I tap on it, it will hide everything except the stage and the green flag.

So I can use this to test my programme and see the results nice and big.

I'm going to press the green flag so the chicken will run.

Excellent.

And then tapping on the frog will run that programme too.

<v ->Well done.

You've done so well.

</v> You've finished the first section of today's lesson.

Create sequences using different event blocks.

Let's move into the next section of today's lesson.

Create an animation of the seasons.

I'm really looking forward to this.

Let's get started.

Create an animation of the seasons.

When you have more than one page, you can change between them.

On the left, I've got a page.

It's showing a field.

And on the right, I've got another page.

A forest with a stream running through it.

I can use the change page block to change between these pages.

This might be useful if I'd like to have another background for my sprites.

The change page block only works if there is more than one page in your programme.

You can add a new page to your programme here.

The change page block will let you programme a change from one page to another.

Here, you can see the change page block.

It's red.

Watch this animation.

What do you see? I wonder what the sequence of commands would be here.

This is the algorithm for this animation.

And remember, an algorithm means a sequence of steps.

The steps for this animation are tap sprite, say "hi," and change to river background.

This is the algorithm.

When the sprite is tapped on, it will say "hi." The page will then change to the river background.

What happened? The sprite was tapped.

Next, the sprite said "hi." Finally, the page changed to the river background.

These are the ordered steps.

Which command blocks do you think were used? Pause the video to have a think.

The command blocks that were used were start on tap, say "hi," and change page.

When the sprite is tapped on, it will say "hi." The page will then change to the river background.

I've got a question here for you.

I'd like you to give it a try.

True or false? You add a new page by tapping here.

Take a little look at the picture and answer, is that true or false? Pause the video to have a look.

The answer is false.

Why is that? You use the blue plus button on the right menu to add a new page.

Can you see it? Create an animation of the seasons.

You're going to use the new blocks to make an animation about the seasons.

What order do the seasons come in? Pause the video and have a think.

The first season is spring.

After that, we have summer.

Then, what's next? Autumn.

And finally, winter.

Look at this algorithm.

What is going to happen? Pause the video to have a look.

Watch this animation of spring changing to summer.

First, I tap on the sprite.

The sprite says "Spring." And finally, I change to summer.

Let's watch it again.

Tap on the sprite.

Sprite says "Spring." And my page changes to summer.

Well done.

You're doing so well! I wonder, this command block that I see here, is it the, A, start on tap block? Is it the, B, say block? Or is it the, C, change page block? Pause the video to have a quick think.

Well done for having a try.

Did you get C, the change page block? If we create an animation of the seasons, which command blocks will we use in this animation? Do you remember what happened? We tapped on the chicken sprite.

The chicken said "hi." And then there was a page change.

Which blocks can help us complete the programme? Have a little look at the blocks and see if you can work it out.

Well done for having a try.

These command blocks will help me to complete the animation.

I've got the say block, the start on tap block, and the change page blocks.

I won't need to use the other command blocks.

I've got a task here for you.

I'd like you to create an animation of the seasons.

Use this design to make your own animation.

Add the page backgrounds first.

Next, make the sequence for the first page and then work down.

Let's take a little look at the task.

Can you see the background I start with firstly? It's the spring background.

And my sprite is a chicken.

The algorithm is tap chicken, say "Spring," and change to summer background.

Make that sequence first and then work down the page.

Well done for having a go of that task.

I'd like you to watch this video to see the seasons animation.

<v Instructor>In this task,</v> we are creating an animation based on a design.

First things first is to get the sprite.

Then we are going to get the background.

Now with this animation, we need to make sure we're choosing the right background.

So as you can see at the top, they've got a label.

This one says Summer.

We are looking for Spring, the first part of the animation.

There it is.

So up at the top, check the label is correct.

And then you can add it to your project with the blue tick.

Next, I'm going to add a page and then add my sprite.

Go up and change the backdrop of the page, making sure I'm choosing Summer.

And then adding a new page.

Getting my sprite.

What will be the next one? In the seasons, it's going to be Autumn.

So this is an American programme, so they call it Fall.

I'm going to tick that.

And then for the last one, add the page.

Get my chicken.

And then find the backdrop that is Winter.

Great.

Now that we've got the pages and the backdrops all sorted out, let's put some programming onto the sprite.

So we need to a start on tap block.

And when we tap on the chicken, the design says that we want it to say something.

So we can change the say block value here.

We can tap on it, and use our keyboard or our touch screen to type in Spring.

And then we need a new end block, which is going to take us to page two.

So let's look in the end blocks.

You can see they're numbered two, three, and four.

So we're going to go to page two and add it to this chicken sprite.

When we tap on it, it says "Spring" and takes us to the next page.

That's excellent.

So let's build the programme for this chicken.

Start on tap.

Say block that's going to say Summer.

And the end block taking us to page three.

There we go.

Let's test that.

This is looking good.

Let's get our next start on tap and our say block.

What are we going to get the chicken to say? Check the design if you're not sure.

Autumn.

And page four.

Test it.

Now on the last page, we want to have the same commands.

Start on tap and say, except we wanted to go back to the beginning again.

So what I would do is use page one end block here.

After the chicken says "Winter," it will go back to the start of the animation just like that.

We can test this animation in full screen.

So now we can only see the stage.

Spring.

Summer.

Autumn.

And winter.

<v ->Fantastic.

You've done so well.

</v> And we've gotten to the end of today's lesson.

Let's summarise before you go.

Summary.

Building blocks to create a sequence.

An algorithm is a precise set of ordered steps that can be followed by a human or a computer to complete a task.

An algorithm can be created by following a design.

Sprites are objects that can be controlled by a programme.

Different command blocks are combined in sequences to make programmes.

The start on tap and green flag blocks are event blocks.

They are used to start programmes.

Well done.

You've done so well in today's lesson.

I look forward to seeing you soon.