S l Learn Programming Code Book
P t B Learn Programming Code Book
Book 1 Code Book For Scratch 2.0 visit http://icomp.site/scratch-2 Learning to program is easy with. This workbook is designed to complement our best selling whole-school computing scheme of work - for Primary Schools. It is matched to our Year 3 curriculum but can be used independently and flexibly to suit the needs of your pupils. The four workbooks in the series are loosely based on computing progression from Year 3 to Year 6 in Primary Key Stage 2. Following the creative and fun activities enables children to practice what they have learned, develop and consolidate their computational thinking and coding skills. www.icompute-uk.com
Activity 3 Activity 3 Animation Mapped to iprogram Unit 3.2.3 In this activity you will program a sprite to appear to walk. 1 Start a new project and delete the cat. Now, we ll add a backdrop to our project by selecting Choose a backdrop. The backdrop will appear in your stage list. 2 Next, we ll add a sprite to the stage that we will program to walk. Open the sprite library by selecting Hover your mouse over a sprite to see its animation and choose a walking sprite. Drag to position and resize if necessary. 3 Click on the Costumes tab to open the costumes pane. Notice there is more than one costume for your sprite. These are the sprites walking poses. www.icompute-uk.com 6
Activity 3 4 To make our sprite look like it is walking across the stage we need to switch between the walking poses. Select the code tab, drag out a Green flag clicked block and attach a repeat block. Change the value to 40. 5 We need to swap costume every few steps. Snap a next costume block from the Looks palette inside the repeat block. Add a move _ steps block and a block to set your sprite at the start each time. 6 Press to execute your code. Now add another walking sprite to the stage. This time we will program it to walk using arrow keys. 7 Drag a When _ key pressed from the events palette. Enter up arrow Snap 2 switch costume to blocks to it Make sure each has a different costume. What do you see? www.icompute-uk.com 7
Activity 3 8 The sprite is moving too quickly for you to see. We need to add a wait block to slow things down. Snap a wait block between them. 9 Now lets make the sprite walk forever when the key is pressed. Snap a forever block around the costume animation. Then add a move block. Next Steps Change the wait time. What happens? Change the move steps. What happens? Stop the sprite walking off the end of the stage. Use Scratch drawing tools to draw your own sprite with at least two walking poses. Change your code so that the user moves one of the sprite using arrow keys. www.icompute-uk.com 8
P t B Learn Programming Code Book
Book 2 Code Book Download Robomind at: icomp.site/links Download s Robomind maps at: icomp.site/icomp-robo-maps Learning to program is easy with. This workbook is designed to complement our best selling whole-school computing scheme of work - for Primary Schools. It is matched to our Year 4 curriculum but can be used independently and flexibly to suit the needs of your pupils. The four workbooks in the series are loosely based on computing progression from Year 3 to Year 6 in Primary Key Stage 2. Following the creative and fun activities enables children to practice what they have learned, develop and consolidate their computational thinking and coding skills. www.icompute-uk.com
For this activity you will need maps Resource4.2.5a; Resource4.2.5b; Resource4.2.5c and Resource4.2.5d Activity 5 Activity 5 Decisions Decisions Mapped to iprogram Unit 4.2.5 In this activity you will program something to happen depending upon whether something is true or false 1 Open Robomind and open the map Resource4.2.5a.map Select Edit à Insert à Conditions and choose the first if statement in the list. 2 This is inserted in the script area if ( ) { } Using your mouse, put your keyboard cursor inside the if statement s curved brackets if(é) 3 Now we will add the condition to test whether it is true or false. Select Insert à See and click frontisbeacon Now put your cursor inside the if statement s curly brackets www.icompute-uk.com 10
For this activity you will need maps Resource4.2.5a; Resource4.2.5b; Resource4.2.5c and Resource4.2.5d Activity 5 4 We want to program the robot to pick up the beacon if it is in front of it. Choose Insert à Grab à pickup Now execute your code by clicking 5 We need to program the robot to keep turning until the beacon is in front. Open the map Resource4.2.5b.map Write some code that makes the robot turn and pick up the beacon if it is in front. 6 Repeat step 5 for Resource4.2.5c.map and Resource4.2.5d.map Then, using a repeat loop, program the robot to keep turning, picking up the beacon if it is in front. Then add a break. This code should work for all the maps! You could use a repeatwhile loop and test the frontisclear condition here. Next Steps Using squared grid paper, design your own simple map for Robo that involves repetition and conditions Design a program using repeats and if statements to make Robo pick up the beacon Now use icomp.site/robo-map to make your map into a map that Robomind can use Download the map to your computer and challenge a friend to open it in Robomind and program Robo to pick up the beacon 1
P t B Learn Programming Code Book
Book 3 Code Book Access Scratch at: icomp.site/scratch-3 Download Microsoft Kodu at: icomp.site/download-kodu Download supporting resources at: icomp.site/codebook-3-resources Learning to program is easy with. This workbook is designed to complement our best selling whole-school computing scheme of work - for Primary Schools. It is matched to our Year 5 curriculum but can be used independently and flexibly to suit the needs of your pupils. The four workbooks in the series are loosely based on computing progression from Year 3 to Year 6 in Primary Key Stage 2. Following the creative and fun activities enables children to practise what they have learned, develop and consolidate their computational thinking and coding skills. www.icompute-uk.com
For this activity you need Kodu program file Resource5.3.3a.kodu Kodu - Activity 3 Activity 3 Jumping with keys Mapped to iprogram Unit 5.3.3 In this activity you will program a cycle to respond to user input 1 Locate Resource5.3.3a on your network and open it with Kodu. Press, select the object tool then right click the cycle and choose program. 2 Now add a new row WHEN Next click the DO stack and click actions, more and add a jump tile. Execute 3 Let s add some code so that the cycle scores a point each time a missile hits Kodu. Program the cycle with: WHEN DO www.icompute-uk.com 14
Kodu - Activity 3 4 Let s make the game fairer by programming Kodu to move and return fire. Select the object tool Kodu, then Program and choose 5 Program Kodu so that WHEN DO. Then WHEN DO Next Steps Add some obstacles to the world for the cycle to avoid Program the cycle to be damaged when it bumps an obstacle or is hit by a missile, or reduce points scored when hit Add terrain to the world so that the cycle does not have so far to jump over water Add obstacles for the cycle to collect (E.g. apples, hearts or coins) and score points when collected Program the game to end when a certain number of points are scored www.icompute-uk.com 15
P t B Learn Programming Code Book
Book 4 Code Book Access Scratch at: icomp.site/scratch-3 Access BitsBox at: http://icomp.site/bitsbox-hoc Learning to program is easy with. This workbook is designed to complement our best selling whole-school computing scheme of work - for Primary Schools. It is matched to our Year 5 curriculum but can be used independently and flexibly to suit the needs of your pupils. The four workbooks in the series are loosely based on computing progression from Year 3 to Year 6 in Primary Key Stage 2. Following the creative and fun activities enables children to practise what they have learned, develop and consolidate their computational thinking and coding skills. www.icompute-uk.com
Bitsbox - Activity 4 Activity 4 Jolly Good Coding! In this activity you create an app to catch falling presents 1 Create a new blank Bitsbox app. Start by filling the canvas with a Christmas themed background. Then add a stamp for Santa and a stamp for a present. Add a song for extra Christmas Spirit! 2 We need to make a loop for Santa to fly. We also need presents to drop randomly. This can go inside our loop too. The wrap() function makes the objects scroll (reappear on screen when they hit the screen edge) 3 Next, we will program a function that is called when the present is tapped. Program the present to disappear, and then reappear at a random position. Get creative by adding sounds and effects! www.icompute-uk.com 12
Bitsbox - Activity 4 4 Let s make things more Christmassy by programming snow to fall! We need to create a new function for that. Remember to call the function from inside the main function loop. 5 Now we have a working app, explore lots of different Bitsbox features like sound, songs, fills and stamps. Combine them with commands to improve your app and get Jolly Good at coding! Next Steps You could add another sprite and program it to throw snowballs at Santa s sleigh Add a message and program it to move on the screen E.g. Happy Christmas or Ho Ho Ho! Can you use basic shapes to draw a snowman? You could use circle commands to draw circles of different sizes for the head, body, eyes, buttons and lines for nose, mouth and arms. Make it as detailed as you can! www.icompute-uk.com 13
p ste p ste by INSPIRING THE NEXT GENERATION A computing scheme of work for teachers of all levels of experience. Fully matched to the National Curriculum for Computing. A Complete Primary Computing Curriculum All the materials schools need to teach computing from EYFS to Year 6 Used by thousands of teachers around the world, it contains all the materials schools need to teach computing creatively and with confidence. Our Products Fully matched to the National Curriculum for Computing Used by thousands of teachers around the world in the ng puti Com the in rs ly Ear Yea ng puti Com ith w s ipad for EYFS ipad ide Cu www.icompute-uk.com in the EYFS www.icompute-uk.com Curriculum - Years 1-6 for ipad Across the Curriculum Computational Thinking Puzzle Workbooks www.icompute-uk.com