Loading...
Hi I'm Allen, your computing teacher for this unit, Physical Computing.
And this is lesson five, which is called Mixing It Up.
In this lesson you're going to use all the skills you've learnt throughout the course of these lessons, to produce your own working game on the micro:bit.
As always, turn off all notifications and remove any distractions.
And when you're ready, we can get started.
In this lesson we're going to create a game for the micro:bit, that uses all of the skills that you've learnt throughout this unit.
As you know, we've looked at buttons, we've used gestures, we've lit up LEDs, and we've produced sound.
Sometimes using GPIO pins to sense a touch on one of the pins, or if we connected crocodile clips up and lit LEDs up.
All of those things together, have allowed us to get to grips with the input and output features of the micro:bit.
So I want to provide you with a scenario in a second and it's going to require you to write a programme that incorporates lots of what we've done during these lessons.
So you may have to go back and look at some of your old programmes, to see some of the code.
you will, by the end of it, have a working game that you'll be able to play on your micro:bit.
Okay, task one is to decompose a guess the number game.
Guess the number means that the user will think of a number, so if I think of, you know, number 74, then the micro:bit will guess a number and we'll have to produce some input or provide some input to the micro:bit, to tell it whether it's higher or lower than the number it's guessed, okay.
Using the worksheet, you're going to break down the problem into other sub problems. Okay, so don't think of the problem as one big programme, think of it in smaller parts.
What are the individual bits that need to be solved? There's a lot more information in the worksheet for you, to give you some ideas on what the programme needs to be able to do.
So go ahead and pause the video and complete the task.
Okay, well here's my list for if I was decomposing a guess the number game.
So we need some way of starting the game.
So it may be by shaking the micro:bit or pressing a button, that's up to you.
We need some kind of starting variables for where we're going to guess, compare a guess to.
Some conditions for guessing, response from the user.
So what are we going to use there again, buttons or gestures.
And what to do if the guess is correct or incorrect.
So when it's correct, are you going to be able to you know, show a display or show a tick or play a tune, or both would be great.
And what to do if the guess is incorrect.
So again, are you going to put a cross, or some kind of disappointing melody.
Could do that kind of thing, and then ending the game, what happens at the finish? And if you want to restart it.
Okay, so lots of those things, most of those things you've done in the previous lessons.
So now it's just a case of using all those skills to produce something new.
Okay, so now task two, coding the guess the number game.
You've got the whole problem broken down into sub problems. So now what you're going to do, is you're going to solve those problems individually and build it all up together, to create a working game on the micro:bit.
Don't forget to test regularly, so that you know that one piece is working and then you can move on to the next part of the game, best of luck.
Okay, I hope you enjoyed this unit and I hope you enjoyed creating a guess the number game.
I've certainly enjoyed it, don't worry too much if you didn't manage to get a fully working game.
I have provided you with a link for a working solution, right at the very end of the worksheet.
I think you should share your work with Oak National.
If you'd like to, please ask your parent or carer, to share your work on Instagram, Facebook, or Twitter tagging @OakNational and #LearnwithOak, see you next time.