Scratch

Scratch is a simple programming platform that anyone can use to make their own programs

There are two versions of Scratch: 

Scratch 2 is available online at http://scratch.mit.edu/

Scratch 1.4 is still available. This is the version I use on my Raspberry Pi, in school and in our CodeClub sessions.

You can find me on the Scratch site. Most of what's there is mine, but some is uploaded by kids in CodeClubs I run.

Parking Barrier Simulation

posted 27 Mar 2017, 01:26 by Andy Lakin-Hall   [ updated 27 Mar 2017, 01:27 ]

Scratch 2

In my Year6 Computing Class, we are learning about programming physical systems. One of the examples we are following is a Parking Barrier.

Here's a flow chart that shows how it needs to work.

 


Monkey Bonk Game

posted 6 Dec 2016, 09:27 by Andy Lakin-Hall   [ updated 6 Dec 2016, 11:01 ]

Here's a game I've made in Scratch 1.4. Bash the monkeys to make them go down.

Karate Scratch Game

posted 4 Dec 2016, 13:20 by Andy Lakin-Hall

https://sites.google.com/site/littlesquirtswaterrockets/projects/scratch/_draft_post/KarateGameImage.png
I shared this game on Scratch in March 2014, but only just remembered to blog about it.

You can find the game at https://scratch.mit.edu/projects/19182824/

How to Play

  • When the karateka strikes you have only a short time to block his attacks. 
  • Click any raised hands or legs to block them. If you click the wrong bit he'll add an extra block.
  • Each round he gets a bit faster.

I made this game in 2003 originally using Powerpoint and macros as a demo game for Smartboards in my school. Trouble is, the different versions of Powerpoint muck up the way the code works, and people are reluctant to activate macros - so it won't run on different computers reliably. Finally I got round to remaking the in Scratch so everyone can play.

Karate Handheld Game CompleteI've also just finished building a handheld version of this game using Arduino. Check out the blog page about that if you are interested.


Pumpkin Invaders

posted 18 Oct 2015, 04:37 by Andy Lakin-Hall   [ updated 4 Dec 2016, 13:25 ]

As it's that time of year, I thought I'd write about making a pumpkin themed game - Pumpkin Invaders!

Lets start with drawing a pumpkin. This is really easy in Scratch. I'll be describing Scratch 1.4 for this game, but it should also work in a similar way in Scratch 2

Start Scratch 1.4 and delete the cat sprite.

Draw a Pumpkin

Choose Paint new sprite .

Choose the Ellipse Outline and draw a pair of overlapping brown circles .

Fill these with orange 

Add a little stalk 

Make a COPY of this costume, just in case you make a mistake.

Off to the side of the pumpkin, draw an eye 

Use the Stamp tool to make a copy of the eye 

Use the selection tool and the Flip Horizontal tool   to flip the right eye over 

Use the selection tool to move the eyes into position 

Now make a COPY of this costume before you draw on a mouth. You need to have two pumpkin costumes; one with a zig-zaggy mouth, one with a spit mouth.

 

Now you are done drawing these two costumes, you need to ROTATE both costume 90° to the right, so the stalk aligns with the blue sprite direction line, which defaults to point right. If you forget to do this step, later when you try to get the pumpkin to point towards the mouse pointer it will be 90° off.

In Costume Edit, click the Rotate Clockwise control three times to rotate both the pumpkin costumes 90° to the right.
 

You could have tried drawing the pumpkin pointing to the right in the first place, but I found that very hard to get right, and it was easier to draw it upright and then rotate it.

Name the sprite pumpkin and the costumes, blank, pumpkin and pumpkin spit.


Draw a seed

Your pumpkin needs a seed to fire. Choose Paint new sprite  and draw a small ellipse . Draw it sideways, so it aligns to the blue sprite direction line. Name the sprite seed.

Pumpkin Basic Script

The following script for the pumpkin makes it always point towards the mouse pointer. It also handles the seed firing, switching pumpkin costumes and broadcasting the command spit seed.

Seed Script

Here are the scripts for the seed. The seed is hidden at the start. When it receives the broadcast spit seed from the pumpkin, the sound effect is triggered, then the seed sprite goes to the pumpkin and points in the same direction. Then the seed is shown and it starts moving forward until it touches the edge of the screen. At the edge of the screen, the seed hides once again.

The third script handles what happens after a seed hits a ghost (we haven't made them yet). After hitting a ghost, we need the seed to vanish. But we don't want to do that until after the ghost has detected the sprite collision, so this waits until the hit ghost broadcasts that it has been hit, and then hides the seed.

The Ghost

Click Choose A New Sprite from File  and inside the Fantasy folder find the ghost2-a sprite 

Name the sprite ghost1 and name this first costume Happy Ghost.

Copy the happy ghost costume and change the name of the copy to Sad Ghost. Edit it this costume and paint over the smiling mouth, replacing it what a sad face.

Make a variable for this sprite only called speed, and then build this script for movement.


Ghost sprite collision routine

The Ghost sprite collision routine is quite complicated, but bear with me and I'll try and explain all the steps.

First set the ghost to be hidden.

Next we set the ghost's appearance; the fisheye effect is set to 0, the costume is switched to Happy Ghost and the ghost effect is set to 50, to make the ghost appear ghostly and transparent.

The variable speed is set to a random pick between 2 and 5.

The ghost's Y-coordinate is set to a random pick between 0 and 150.

The ghosts's size is set to a random number between 25 and 50%

The ghost plays the ghostly moan sound effect.

The script waits until the ghost sprite is touching a seed sprite.

Set the speed to zero, to stop the ghost sprite moving.

Switch the costume to sad ghost. The ghost is sad, because it's been hit by a seed.

Broadcast hit ghost. This will tell the seed it can disappear now.

Wait a second.

Then follow the repeat 10 loop, changing the ghost and fisheye effects to make the ghost appear to squish up and fade away.

After the loop, set the ghost sprite to hide.

Now the ghost is vanished, wait a random pick number of between 2 and 3 seconds, and we get to the end of the loop and go around again.

Add a background

Click the stage and change import the background from the nature folder called woods.

Test the game

The game can be run like this. Just duplicate a few extra ghosts and click the green flag for some ghost shooting action.

Add Score

We need to add a scoring system next. While on the stage, add a variable called score.

Add the following script

Because we've already using that hit ghost broadcast every time a ghost is hit, we can use it to detect that event and increment the score.

We will need to reset the score to zero at the start of every game, and you can do that by adding a When Green Flag Clicked, Set score to 0 script.

Game Timer

The game needs a timer, so create a variable called Time and build this script;

This starts by setting the score to zero, then setting the Time variable to 30.

The repeat 30 loop counts down thirty repeats of Wait 1 second, and then does Stop All, which will stop everything.

The Countdown Spider

Rather than use an orange variable number to show the game time countdown, I want to use a graphic - a countdown spider.

This spider has been drawn in Scratch, mainly with the ellipse tool. The legs are straight lines.

When the spider is complete, make a copy.

Use the Text Tool to position a number on the spider's tummy. Start from 10, then copy that costume, and then edit the text to say 9, and so on, down to zero. In all you'll need twelve spider costumes. The first blank. The second with 10 and then counting down to zero.

Here's the script for the Counting Spider;

The first script handles the position and size of the spider, and sets up the blank costume for the start of the game.

The second script starts when the Start Counting broadcast is made. We haven't made that yet - don't worry.

The repeat loop makes the spider jiggle and then switch to the next sequential costume. The two delays; Wait 1.5 seconds, mean that over ten repeats the script will take a total of thirty seconds, which is the same duration as the game timer on the stage.

Front End

In the final step we want the game to run over and over again, without having to click the green flag. For this we need to make a front end.

Using the Nature - Woods background as a starting point I have created this background image to display on the stage when the game begins;


Can I Tell You A Joke?

posted 2 Oct 2015, 12:41 by Andy Lakin-Hall   [ updated 2 Oct 2015, 12:44 ]

One of the features of Scratch which I use very little is the Lists function.

Hidden away under the orange   section, the   function allows you you create a list of words. There are functions which allow you to select any item of the list, and also to check to see if a particular item is in the list.

To showcase this function, I have created an example program which you can try building for yourself.

Getting Started

You can use the default Scratch Cat, but I've switched to Gobo. On the Gobo sprite, add the following blocks 

If you Green Flag this script, Gobo will ask you to enter your name, and then say "Hello," to you, and ask the important question; "Can I tell you a joke?"

The Dilemma

The problem with this simple question is, there are a lot of ways of saying "Yes" that the user might enter. Here are some possibilities;
  • yes
  • Yes
  • YES
  • ok
  • OK
  • okay
  • Okay
You need to think about ALL the ways that a user might ener "Yes" because if you miss one, your user will get frustrated.

So you need to build your first list. Go to  and then click  for this sprite only. Call the list "ways to say yes" and add all of the alternative ways you can think of to that list.

Now add the IF - ELSE Block like this;

Notice how in the IF part of this block, I have used the operator that checks to see if a particular item is is the list. Here I've selected the Ways to say yes list, and also used the variable answer, which contains whatever the user entered. This checks through the entire list to see if it matches. If it does then the broadcast QUESTION is launched (We will build that later).

If the list does not contain whatever the user entered, then the ELSE section runs, and you need something to happen as a response to that. I've made Gobo do a dance, and included a broadcast to make that happen.

The Dance

So here's the simple little dance. You could change this, or do anything else you like.


The Joke

Assuming the user enters "Yes" to the question, the next thing is to actually deliver the joke.

You need to create two new lists for this sprite only; one of joke questions, and one of joke answers.

 #  Joke  Answer
 1  What's brown and sticky?  A stick!
 2  Why to bees hum?  Because they don't know the words!
 3 How many legs has a horse got?  SIX! Fore legs in front and two behind!            
 4  What's yellow and dangerous?  A zombie banana!

Enter these  jokes - or your own better ones, into the two lists. Make sure the answer matches the joke, or things will look really weird!

It doesn't matter how many you include, but four would be the minimum.

Next you need to create a variable for this sprite, called Which Joke. This variable will store the result of a random pick.

Build up the following block;

See how the variable Which Joke is set to be a random number between 1 and the length of the list of jokes. That means that you could add more jokes to the list, and the program block will still work.

Now you've set Which Joke to say use the Say for 2 Seconds block to first say the joke, and then say the answer.

The script will end then, but if you want, you can put the whole thing in a Forever loop, so it goes back to the start and does it all again.

Here's the entire script;

You can download a copy of my example here;

But I'm hoping you'll build your own version.

Roman Palisade Attack

posted 28 Sep 2015, 08:15 by Andy Lakin-Hall   [ updated 8 Oct 2015, 13:21 ]

We like to make Scratch projects that link to topic work we do in school, and this term Year 5 are learning about the Romans. Their Computing task is to make an interactive game, so here's a chance to build a Roman themed interactive game in Scratch.

Concept

I'd like the game to feature Roman soldiers attacking a palisade, and for the player to control an arrow-firing ballista. The soldiers will slowly approach the palisade, and the player controls the ballista and fires arrows to shoot the attackers.

Sprites

I'll need sprites for the Roman soldiers, the ballista and the arrows it will fire. I'll also need a background image.

Here's my Roman soldier. This was drawn using Serif DrawPlus and exported as a GIF.

Here are two costumes for the arrow-firing ballista. One shows the ballista ready to fire with an arrow in place. the second shows the ballista unloaded. Drawn using Inkscape and exported as a PNG file.

Here is the sprite for the arrow, also drawn in Inkscape.

I'll need to rotate the ballista and arrow 90° right, so they match with the Scratch orientation of the direction pointer.

Here are these two images imported as costumes. You can see how I've rotated them so they orientate to the blue direction line. I've also labelled them "Fired" and "Loaded".

Ballista Script

Here's the script for the ballista. It turns left and right with the arrow keys, and then does a firing action when space is pressed.

The command - broadcast "fire" sends out a broadcast signal that the arrow sprite can wait for.

Arrow script

Here is the script for the arrow. The arrow needs to be hidden until fired. Then is needs to go to the ballista, and point in the same direction. Then it should move forward while getting smaller, making it appear to move further away.



The Background

Now we need a suitable background. I've used the Hay Field background from the Outdoors folder, but I've moved it up a bit and put a bar of olive-brown at the bottom to represent the palisade. When I put the soldier sprite in, I can add an algorithm to detect when it reaches the palisade and trigger the Game Over sequence.

Importing this into Inkscape, I have added some lettering to create a Game Over screen, then exported that out again as a JPG.

Both of these images need to be imported onto the stage and names appropriately. 

There are a couple of scripts for the stage too.

 The first sets the hay field background when the green flag is clicked. This also sets a Game ON flag variable to true. We'll use this to let our other sprites know if the game is over or not.

The second script waits until a Game Over broadcast is received, and then switches to the Defeated background and changes the Game ON flag variable to false.


The Soldier

The soldier has two scripts; both are a bit complicated, but hang in there!

The first script makes the Roman move towards the ballista until it gets to the palisade. The soldier should only move if it isn't dead, so it needs to use a flag variable just for itself called "alive". The soldier will keep moving towards the ballista until touches the palisade colour, unless it is temporarily dead.

The second script detects if the soldier gets hit. It begins by setting the alive flag variable to true (which allows the other script to make it move forward). It then goes to a random starting point and sets up the sprite tot he correct size, colour and position.

The the script waits until the sprite is touching an arrow. If it does touch an arrow, the next bit will follow where the OW! sound plays, the soldier goes green and then fades away. Then the script loops back around, repositioning the sprite at the start for another attack. It will keep doing this until the Game ON flag is false - which means a soldier has touched the palisade.

Game Stage 1

If you've done all that, then you should have a simple game with a Roman soldier attacking your position. 

Here's a copy of my version of the game at this point. It includes the sound effects too.

What next?

The basic mechanics of the game should work now, but it isn't really playable, so you'll need to add some features.
  1. Scoring. Get some points for shooting a Roman.
  2. There's a bug in the arrow firing mechanism - if you press space again the arrow doesn't complete it's flight, it just leaps back to the ballista.
  3. Add more soldiers. Duplicate the soldier sprite a few times and have a legion attack at the same time.
  4. Include waves of attacks, so the game is easy at the start, but gets harder with more soldiers when you start to score big.

Can I have the resources?

Pop The Spider

posted 27 Jun 2014, 04:30 by Andy Lakin-Hall   [ updated 4 Dec 2016, 13:27 ]

Here are some step by step instructions to get you started with making a game.

Open Scratch and delete the cat sprite by right-clicking over it and selecting DELETE.

Draw a spider

 Click on the PAINT NEW SPRITE icon. Use the painting tools to create a spider, like the one on the right.

As you draw your spider, make sure it is facing to the right. In Scratch, sprites move to the right by default. If you draw it facing left then your spider will seem to be moving backwards.

Name Your Spider

When you create a new sprite, Scratch gives it a default name. Your spider might be named 'Sprite1' just like in the image left. It is a better idea to name all your sprites. This helps when building the stacks of commands, as you will be able to tell what object the command is about. Click in the box where it says 'Sprite1' and rename it to 'Spider' .

You will see three tabs labelled 'Scripts', 'Costumes' and 'Sounds'. Scripts are where you will build up your stacks of commands to make things happen. Costumes are where you find the various different images which a sprite may look like. Sounds are for sound effects.

Click on the Scripts tab, and you will be able to start building your program.

Begin Programming

We want the spider to move around the screen, but first we have to decide what will trigger that event. Look on the left of the screen to find and left-click the Control button

Choose the When Green Flag Clicked  block, and drag that into the scripts area.
Now click the blue Motion button . You will see that the commands the are to do with motion appear below it. Choose the block that says Move 10 steps and drop it below the When Green Flag Clicked command. you should notice that when it is in position the movement command snaps to the Control block.

 like this.

If you click on the green flag, top right of the screen, that pair of commands will run. The spider will move ten pixels to the right and then stop. We want the spider to move and keep moving, so we need a command to make the movement keep happening.

Click on the Control button once more and scroll down that list to find the FOREVER loop.

 Anything that is put inside a Forever loop will be done over and over again. Take the Move 10 Steps block off the When Green Flag Clicked control and drop it inside the Forever loop. Then drag the Forever loop with the Move 10 Steps block nestled inside and join it on to the When Green Flag Clicked control.
 Now when you click on the green flag top left the spider will move right and keep doing it until it hits the edge of the screen, where it gets stuck.

Look back in the blue Motion commands until you find the command If On Edge Bounce . Drag that inside the Forever loop, just below the Move 10 Steps command.

 This time when you click the green flag, the spider will move backwards and forwards across the screen, bouncing off the edges. You can change how fast it moves by changing the number in the Move 10 Steps block. Make it move 5 steps instead.

You will also notice that the spider flips upside down when it bounces. You can make the spider only face left and right by clicking on the Only Face Left-Right button. 

Look at the top of the screen where you previously renamed Sprite1 to Spider. There is a double-head arrow there which, if you hover your pointer over, will show you is named Only Face Left-Right. Click on that to set the spider to only face left and right and the spider will stop flipping over as it moves.

You will also see a tiny blue line over the little version of the sprite there that indicates it's current direction. If you drag that blue line around to about 45° you will see the spider now bounces around the screen at an angle.

Stage backgrounds

Now double-click on the white stage where the spider is moving. You will notice all your scripts have gone! Do not panic! You have just selected the Stage instead of the Spider sprite. There are no commands on the stage yet.

Look at the bottom right of the screen and you will see a light blue round-cornered box around the little icon of the Stage. Click on the Spider sprite, and that will become selected. You should see your script reappear in the script editing area.

Click back on the little Stage to select the Stage for editing.

We don't need to add any commands to the stage yet,but the plain white background is rather dull. Where previously you could see three tabs labelled 'Scripts', 'Costumes' and 'Sounds', you will now see You will see three tabs labelled 'Scripts', 'Backgrounds' and 'Sounds'.

Click on the tab marked backgrounds.

You can paint a new background, import an image or (if you have one) take a snap from a camera. We are going to choose one of the pre-installed selection of backgrounds. Click on Import and a file-system window will open.

By default, this file system window will be focused on the Backgrounds folder of wherever Scratch is installed. You can use the buttons on the left had side to jump to other drives on the Computer, to the User's Documents folder, to the Desktop or to the Backgrounds folder. 

Double-click on the Nature folder and scroll down the list until you find the woods image, then click OK.

The woods image will be imported to the stage, and you will see a thumbnail of it below the original plain white background1.

You can delete background1 by clicking on the little round x symbol beside it, or by clicking on the scissors icon and clicking the scissors over the unwanted background.

Change The Size

Now the spider is moving around the screen over the woods background. The spider is a bit large, so we need to change that. Select the Spider sprite and then look on the left of the screen to find the purple Looks commands.

 About two thirds of the way down this list is the command Set Size To 100% .Drag that onto the script area and pop it just below the When Green Flag Clicked block. Take care! If you drop it inside the Forever loop, you will have to drag the other bits out to get it out again. Blocks stick to blocks above, so if you click a block in the middle of a stack all the blocks below it will come along too.

You can change the size from 100% to 50% in that Set Size block, and when the green flag is clicked the spider will change size to whatever you set. We can make our spider be a random size by using an Operator. Look on the left for the green Operators commands.

The fifth item on the list is the Pick Random 1 to 10 block. Drag that out and drop it over the number in the Set Size To 50% block. change the two random numbers so the value picked is between 20 and 100.
Your script should now look like this. Read it through step by step...

When the green flag is clicked, set the sprite size to a random number between 20 and 100 percent. Forever move two steps. If on edge, bounce.

Each time you click on the green flag the spider's size will change.


Repeat Until

Now we are going to make the spider play a pop sound when you click on it. We are going to change the Forever loop to a Repeat Until loop. Go to the Control commands and scroll down to find the Repeat-Until loop.

 take out the commands inside the Forever loop and put them inside the Repeat-Until, then delete the Forever loop.
You will notice the little lozenge shaped space in the Repeat-Until loop. That's a space to drop in a condition. We want this loop to repeat until the spider is clicked. Go to the green Operators and find the AND block . Drop that into the gap on the repeat block.

Choose the light-blue Sensing commands on the left . Pick the MouseDown? block  and the Touching [ ]? block . You will notice a small black dropdown arrow inside that block. Click there to choose Mouse-Pointer. Put both these sensing blocks into the two spaces either side of the AND block. This will make everything inside the loop Repeat, Until the mouse button is down, and the mouse it touching the sprite.

Add A Sound

Click on the Spider Sprite's SOUNDS tab and choose Import. Go into the Effects folder and choose the POP sound effect. The sound effect appears in the list of sounds for that sprite.

Click on Scripts and then click on the pink Sounds commands list on the left. At the top of the list will be a command 'Play Sound Pop' . Drag that below the Repeat-Until loop. Now when the Green flag is clicked, the sprite size will be set to a random number between 20 and 100 percent, then it will repeatedly move 2 steps and bounce on edges until the sprite is pointed at and clicked. The the Pop sound will play.

Disappear

Go to the Looks commands and choose Hide . Put this underneath the Play Sound Pop command. Now when the spider is clicked, the pop will sound and the spider will disappear. From the same list drag a Show block  and drop it right below the When Green Flag Clicked control. This makes sure that if the Spider sprite is hidden at the start of the game, it is initialised to be showing.

When the spider is clicked, it would be good to make it vanish for a few seconds and then come back again for another go. Go to the Control commands and find the block Wait 1 Secs. Change the wait time to 3 seconds  and put that block underneath the hide block.

Drag out a Forever loop from the Control commands and put that right underneath the When Green Flag Clicked control. Put the rest of the commands inside that Forever loop.


Change Speed

We are going to make the spider change speed each time it is clicked now. Click on the Variables control . Click on Make A Variable and it will ask if you want to set a variable name. Type in Speed, and then choose the option to make it for This Sprite Only. That's going to important later when we make duplicates of our spider. With the speed variable set to be a Local Variable (for this sprite only) we will be able to set different speeds for multiple sprites at the same time.

Once the variable is defined, a load more commands appear in the Variables command list. Choose the block that says Set [speed] to 0 . Go back to the green operators and find the Pick Random 1 to 10 block. Drop that over the Set Speed block and change the parameters of the random number to be between 2 and 10.

 Put this block inside the forever loop, just above the Show block.

Over on the left will be a little variable block labelled speed . This has a tick box to the left of it. remove the tick and the Spider Speed display vanishes from the stage. Drag the speed block over the Move 2 steps block that is inside the repeat-until loop. Now, instead of moving 2 steps over and over again, the spider will move whatever number is currently set in the speed variable.


Random Jump

Next we will change the spider to jump to a random place every time it is clicked on.

Go to the Motion commands and look for Go To x: [0] y: [0]  .put that right at the bottom below the Wait 3 Secs block.

Go to the Operators and choose two pick random blocks. put one in the x and one in the y of the go to: block.

Make the parameters for the x coordinate between -240 and 240, and for the y coordinate between -180 and 180. This will choose a random point anywhere on the screen.


Scoring

The next task is to add a score system. Go to the Variables controls and choose Make A Variable. Name this new variable 'Score', and make this variable for All Sprites. This means that if we make duplicates of the spider later, then each one will be able to add to the Score variable. You will see this appear on the stage. You can move the variable display anywhere you like.

Choose the variable block Change Score by [1]   drag it just below Play Sound Pop . This will add one to the variable Score every time a spider goes pop.

We need to make sure that the score is set to zero at the start of the game, and we can put that script onto the Stage script area.

Click on the stage thumbnail, bottom right and go to the scripts tab.

Add a script there that says, When Green Flag Clicked, Set Score to [0]

Add a Timer

We need a timer to count down time to zero while we play, then stop the game.

Make a new variable called Timer. As we are doing this on the Stage it automatically becomes a variable for all sprites. You will see this appear on the stage, and you can move the variable display anywhere you like. If you RIGHT-CLICK over the variable display you will be given the options to change the display to Large Readout or Slider. Choose Large Readout for the timer.

Drag the Set Variable block to the Stage script area. Click the drop-down to change it to the variable Timer. Set it to be 'Set Timer to [30]'. Drop that below the Set Score to [0] block.

Now go to the yellow Control commands and chose the Repeat [10] block. Change the 10 to read 30, then click that block below the Set Timer to [30] block.

Go back to the Variables and find the block Change Score by [1]. Click on the drop-down and select the variable 'Timer'. Change the number to be -1 and put that block inside the Repeat loop.

Stopping When The Time Runs Out

We could just add a Stop All command to the bottom of the timer loop, but that would leave the spider stopped on screen. A better option would be to tell the spider to hide when the timer reaches zero. We can do that by using a Broadcast command.

Look in the Control blocks to find the control called 'broadcast'. Click on the drop-down and choose new...

Name the broadcast, 'Game Over'. Drag the block onto the stage and click it into position below the timer repeat loop.

Now change back to Spider sprite and add the Control block 'When I receive Game Over'. This is an event starter block, just like When Green Flag Clicked.

Go to the looks controls and find the Hide block . Click this below the 'When I receive Game Over' block.

Go back to the control blocks and find the 'Stop All' block. You will see this block is stoppered at the bottom with no space to add anything below this.


Duplicate the Spiders

Right-click over the spider sprite and duplicate it. Make several duplicates until you have four or five identical spider sprites.Because one spider is working, all the duplicates will work in the same way. 

Play the Game

Click the little projector screen icon top right to switch to Presentation mode. The game will change to full-screen.

Click the green flag and the multiple spiders will all start whizzing around the screen. Click each one to pop it and gain points. The game ends after thirty seconds and everything stops.

Hopefully you now have the basics for working with Scratch. There is an online version of this game at http://scratch.mit.edu/projects/24139648/ and you can find the Scratch file attached below.

Instructions for Scratch 1.4

posted 27 Jun 2014, 03:29 by Andy Lakin-Hall   [ updated 27 Jun 2014, 04:13 ]

Getting Started

If you are just starting out with Scratch, a really good starting guide is the Scratch 1.4 Getting Started Guide. This gives a large-print step-by-step easy introduction to the key features.

More Detail

For teachers who need a bit more detail, the Scratch 1.4 Reference Guide has a more thorough explanation of the Scratch interface and programming language.

Resource Cards

A zip-file set of Scratch Cards provide brief explanations that show how to make animations and interactive projects with Scratch. Print these out onto thick paper for reference.

http://download.scratch.mit.edu/ScratchGettingStartedv14.pdf
http://download.scratch.mit.edu/ScratchReferenceGuide14.pdf
 
 
http://download.scratch.mit.edu/ScratchCardsAll-v1.4-PDF.zip

Froggy - a game for MakeyMakey

posted 28 Jan 2014, 06:53 by Andy Lakin-Hall   [ updated 26 Jun 2014, 11:30 ]

http://www.makeymakey.com/
I recently acquired a MakeyMakey interface, and have been looking for a project to use it.

MakeyMakey allows you to create your own keyboard or input device to control whatever you like. In it's simplest form you connect up crocodile clips to something conductive to make switches that correspond to the cursor keys and a the space bar.

You can do a lot more with a MakeyMakey, but I wanted to create a simple game that just involved the cursor keys and space bar, for which I could create a custom controller quite easily as an example project for my CodeClub group. I've embedded the game in the box on the left, but because this site uses https:// the game will just appear blank until you click on the little button at the top of your browser to allow a script from an unauthenticated source. If you don't want to do that, you can see the full game at at http://scratch.mit.edu/projects/17167373/ instead.

Froggy

I worked out that I could position pairs of brass screws through the top of a cardboard box file so that a finger makes a connection between the screws. MakeyMaker interprets that as a key press, and the laptop interprets the signal from the MakeyMakey as if a regular key had been pressed.

Here is my MakeyMakey connected up inside my box file.

I designed a graphic for the top of the box using Inkscape, then printed it out on paper and glued it to the top of the box.

Here is the box from the top.

You can see that each arrow, and the start button have a pair of brass screws where a finger can be placed. In the underside of every screw is a crocodile lead linking the screw to an input on the MakeyMakey.

You can see the Scratch code for this game at http://scratch.mit.edu/projects/17167373/



1-9 of 9