Teach Primary Issue 19.6
WEEK 1 Learning objective l Character movement with user input: code a sprite to move using arrow keys Find example code for this week in the Scratch studio (link above) . This first lesson is a good opportunity to demystify some of the new words we will be using. Begin by explaining that sprites are the 2D graphics that we program to move and interact in games. Pupils will be able to think of lots of examples! Explain that input is a means of giving instructions to a computer, and output is what the game shows or does in response. Or, more simply, input is what M E D I U M T E R M P L A N KS2 COMPUTING Download your FREE accompanying resources at tinyurl.com/tp-ScratchCode DOWNLOAD RESOURCES AT C omputing is a complex subject, rich in specialised language and terminology. One of its most challenging strands is coding. But how do you deliver everything the national curriculum requires if you’re not a specialist? This unit approaches this challenge by using video games as a contextual foundation. Video games are widely understood and relatable for most children, helping them make sense of key computing vocabulary. Over the course of six lessons, pupils will learn the core coding concepts needed to create a simple game, usingMIT’s free Scratch software. The code examples in the accompanying teacher’s resources (link below) are annotated with comments, and could be shared with children who need a little extra scaffolding. Those pupils withmore experience in Scratch can be encouraged to support their peers and, of course, to develop their own games beyond the objectives of these six lessons. the player does, output is what the computer does back. Proceed to Scratch and explain the interface ( scratch.mit.edu ) . On the left, we have the coding blocks, sorted into coloured categories. In the middle of the screen is the workspace, where we will drag blocks together to build a program. On the top right is the stage, where we can see the fruits of our labours. Below that, we have our banks of sprites and backdrops. Where possible, give children some time to explore before starting the project. You may also want to do some exploring yourself if you’re unfamiliar with the platform – go to the tutorials tab on the homepage to see videos explaining how to use Scratch. As we prepare to program our sprite to respond to keystrokes, ask some recap questions to see howmuch the children can remember of the X axis (side to side) and Y axis (up and down) from their maths lessons. For the less confident, it may help to explain that the X axis goes across because it is itself a cross . Demonstrate the code for moving in one direction and give the class time to try and figure out the other three movements by themselves. Assessment Can children add a sprite and code it to move left/right/up/down in response to keystrokes? WEEK 2 Learning objective l Add a star sprite and use ‘Selection’ (and collision detection) so the player can collect it l Introduce debugging In this week’s code, we will add a new sprite (a star) and program it to vanish when the player’s sprite touches it. Begin by recapping on X/Y axes and how we got our sprite to move. Ask children how they think we might add a second sprite. Then, ask how we could get the two sprites to interact. How can the game tell if the player’s sprite is touching the star? How can the game make a decision about what to do if that happens? Move on to explain conditional statements ( IF/THEN ), which are the computer’s way of making decisions. Explain that conditional statements check if something is true or not. In our game, we are checking whether or not the STARTING FROM SCRATCH JOHN BOLTON 30 | www.teachwire.net
Made with FlippingBook
RkJQdWJsaXNoZXIy OTgwNDE2