video

Lesson video

In progress...

Loading...

Hello, and welcome to Lesson 3 of our Variables in Games unit.

I'm Andy, and this lesson is going to look at designing a game.

As with previous lessons, you'll need a web browser and access to the Scratch website.

If you'd like to save any work in Scratch you'll need an account.

If you don't have an account and you're under 13 you'll need to get your parent, carer or teacher to set you up with one.

You'll also need something to write on and something to write with as you'll be drawing out some designs.

So if you'd like to clear away any distractions then we can start.

In this lesson, you're going to design a project that's going to build on an example we'll give you.

You're going to choose the artwork that will go with that project.

You'll be able to think about and explain why you make the choices that you make.

And you're going to create algorithms that will go with the project.

The first thing we're going to do is have a look at a game.

So there's an existing game and you'll have the link in a minute.

And what you need to do is answer the questions that are shown.

So, how would you play the game? How many sprites are there? What the different sprites do? And how do you know how well you've done? If you'd like to pause the video you can go to the project link that's shown.

You can try the game out and answer the questions that shown in your worksheet.

So pause the video now.

So hopefully, you've got some answers to the questions.

How do you play the game? Well, when you open the game, there were some instructions.

It said, press the green flag to start and use the left and right arrows to move the bowl and to catch things.

There was one, two, three, four, five, six, seven, eight sprites.

The sprites did different things.

There was a screen bottom, it marked the boundary at the bottom of the screen.

There was a bowl for catching.

There was four apples, which you got points for.

There was a ladybug, if you caught that you got points taken off and there was a star where you got bonus points.

And actually you had a score.

So at the end of the game you had a score and you knew how many points you've gained and the time that you knew how long you had left while playing.

So we have a game template for you.

The apples and the spider have been removed.

And this is going to be the basis for the game that you're going to make.

Your first task is to choose your artwork.

You're going to choose two more falling sprites.

We've got the star chosen for you, you need to have two more and the background.

So you'll need to make a little sheet like this and write down the name of the sprites you're choosing.

And you can do a little sketch to sketch what they look like, so to remind you, when you get to coding.

So look in the Scratch resources, choose some more, two more falling sprites and choose a background to use.

So pause the video now and you can go and do that task.

So you should have now chosen your artwork, two more falling sprites and the background.

I've put mine there.

I've chosen the ghost sprite as my second sprite and the beach ball as my third falling sprite and the blue sky is my background.

The next thing we're going to look at is algorithms. An algorithm is a precise sequence of instructions or a set of rules for performing a task.

So if we think about our project here's a sketch of what happens when the star falls, that's a sketch algorithm.

And it shows that if it lands in the bowl, you get three points, and if it doesn't, you don't.

But we can also write the algorithm out more clearly.

I'll read the one we've got here.

The falling star moves down from a random x position at the top of the screen.

If the star falls onto the bowl, add three to the score.

When the star touches the bowl or the bottom of the screen it falls again from a random x position at the top of the screen.

You're going to do some algorithm design now.

You need to add two algorithms for the additional two falling sprites that you chose and you can do a sketch and a description like the ones I've just shown you.

These are the kind of things you can put in.

You can choose what those things do when they fall or when they're caught.

So each sprite could change the score.

It could change it by different amounts.

You could have negative numbers, it could take points off.

Each sprite could move at a different speed.

The sprites could be different sizes.

Make sure any of your choices are put onto your design onto your algorithms and your plan.

So the next task is design your algorithms. So pause the video now and draw and describe what each sprite will do in your project.

Pause the video.

So you should have your algorithms sketched out and written out now.

This is the falling star one.

I've decided for this one that when it's caught it adds five to the score.

So it's star points.

This is the one I've done for the ghost.

I think the ghost is a baddy.

So the ghost moves down and if it falls onto the bowl it takes five from the score.

And lastly, I've got the ball.

So when the ball falls, if it's caught, it adds one to the score.

If not, when it touches the bottom, it falls again.

So I've got three different algorithms there.

I've not made any choices about speed or about the size but you could have done that and that can go into your game later.

So if you look through your design can you explain the choices to somebody else? Can you talk about how each sprite would fall down the screen, what makes it move down? How does the bowl move left and right? What happens when a sprite is caught by the bowl? What happens when a sprite reaches the bottom of the stage? What artwork have you chosen? So have a moment looking over your designs, your choices, your algorithms and reflect on those questions and think about how you'd explain what you've got there to somebody else.

So far, we've been looking at algorithms for falling sprites.

We've going to look at some other algorithms now as a final task in this lesson, and you look at a project and think carefully about the algorithms used.

So there's a link in the worksheet.

Look at that project, spend some time using it and think about the different things that happen and what the algorithms might look like for those things happening.

So pause the video now.

Hopefully, you thought of a number of different algorithms, which would make that game work.

There's just a couple I'd like to pull out.

This is the code, but actually, the algorithms were when the game starts the score is set to zero and to make the bowl move there's an algorithm which is the right arrow being pressed, the bowl moves, right? The left arrow being pressed, the bowl moves left.

So in this lesson you chose artwork and you designed algorithms. If you'd like to share your work with Oak National that would be great.

You might want to choose photographs of your designs, your sketches, or screenshots.

If you'd like to share it please ask your parent or carer to share your work on Instagram, Facebook, or Twitter, tagging @OakNational and #LearnwithOak.