Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using is called Scratch, it is completely free and available to download from: http://scratch.mit.edu/ You’ll complete week by week tutorials before finally designing, creating and evaluating your own game
Scratching The Surface Lesson 1 Simple Sprites
Objectives Objectives Learn how to write simple scripts to make Sprites move in Scratch
Scratch In computer graphics, a sprite is a two-dimensional image or animation that is used in a Computer Game Each sprite has a set of rules that define how it moves and how it behaves
Scripts Games are made by giving sprites a sequence of rules to follow. These are called scripts These scripts are often dependent upon other variables or events taking place first Scripts often need to be told to repeat or loop over and over again, until something instructs it to stop!
Open Scratch
This is sprite1, it comes already loaded in the SPRITE LIST and has already been placed on the STAGE Task: Right Click and delete sprite1 from the SPRITE LIST
Task: Click on the insert new sprite button.
Task: Select the sprite called cat2 from the animals folder.
Task: Rename the sprite and call it cat Task: Rename the sprite and call it cat. Remember to always call new sprites sensible names!
Task: From the control menu, drag and drop this rule into the SCRIPTS AREA
Task: From the motion menu, drag and drop the point towards rule into the SCRIPTS AREA and join it inside the forever rule Task: choose mouse pointer from the drop down list.
Compatible rules can be joined together in the SCRIPTS AREA Task: From the control menu, drag and drop the forever rule into the SCRIPTS AREA and join it together.
Task: From the motion menu, drag and drop the move 10 steps rule into the SCRIPTS AREA and join it underneath the point towards rule. Task: change number of steps to 3.
Task: run your program by pressing the green flag.
Notice how the co-ordinates change as you move the mouse and sprite.
Save your work as cat and mouse in your new Scratching The Surface Folder and open up a new blank Scratch screen
Task: Click on the insert new sprite button.
Task: Select the sprite called crab1-a from the animals folder.
Task: click the only face left-right button. Task: Rename the sprite and call it crab
Task: Build and test the following script for the crab sprite. Task: Add a further 3 scripts to make the crab move in all four directions.
Task: click the can rotate button. What happens now when your crab moves? Can you explain why?
Directions – Up; Down; Left; Right
Task: Save your work as in your Scratch Folder
Plenary You should be familiar with most of this code Find and fix the deliberate faults Can you explain how it all works?