jokes - university of warwick · or animal folder. scratch is a project ... in order to increase...

7
Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.edu Tutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected]) Telling Jokes Two characters tell jokes. Create an interaction between two characters. This shows how dialogue can be coordinated. 4. Click on the ‘OK’ button to insert the character. 1. Start a new scratch session, and delete the default sprite. 5. Repeat steps 2, 3 and 4 to select a second sprite. 2. Click on the Choose New Sprite to select a sprite to represent one character. 3. Choose a sprite from the People or Animal folder.

Upload: votruc

Post on 22-May-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Telling Jokes

Two characters tell jokes.

Create an interaction between two characters. This shows how dialogue can becoordinated.

4. Click on the ‘OK’button to insert thecharacter.

1. Start a newscratch session, anddelete the defaultsprite.

5. Repeat steps 2, 3and 4 to select asecond sprite.

2. Click on the ChooseNew Sprite to select asprite to represent onecharacter.

3. Choose a spritefrom the Peopleor Animal folder.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Get the first character to tell a joke!

1. Select the‘Looks’menu.

5. Select and clipon a Wait com-mand and from theControl Menu.

2. Select the‘say..for..secs’ com-mand and place it onthe script area.

3. Edit the text to say“What do you call afish on a motorcy-cle?”

6. Insert a second‘say...for..secs’ command,and edit to say “A motorpike!” for 4 seconds.

4. Change the num-ber of seconds to“4” as shown.

7. Double click on the scriptto run it—watch while oneof the sprites tells the joke.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Now involve the second character.

2. Click on the spritethat represents thesecond character.

3. Now enter the script asshown for the second sprite.

1. Add “When Green flag checked” com-mand from the Control Menu to the top ofthe script, so it starts automatically

4. Try running yourprogram—click on thethe Green Flag. Younow have two charac-ters interacting.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Choose a background for your characters.

2. Click onthe Importbutton, and select abackground for yourcharacters from the win-dow that pops up.

1. Click on the stageto select it.

On running the program,if the text overlaps, ad-just the number of sec-onds on the scripts forthe two sprites to stopthis.

Note:

This method works well for a single joke, but is tedious to get the timing right for multiplejokes, and difficult to change the order of jokes. In the next part of this tutorial you willsee a way of creating a sequence of interactions, that makes it easier to change joke order.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Tell multiple jokes

1. With the first sprite selected,eplace the sprites When GreenFlag command with the When Ireceive command.

4. Select the second sprite and repeat thecommands 1, 2 and 3 selecting FishJoke inthe message box.

In order to increase the number of jokes our characters tell, and also to be able tochange the order easily, we’ll make use of the broadcast mechanism to initiate ajoke. This is a really useful facility when multiple activities need to be co-ordinated. Each sprite listens for a specific message to be broadcast, and thencarries out the associated commands.

2. Click on the littlearrow and select thenew option.

3. In the message boxthat pops up enter thename FishJoke as thename for this joke.

Note:

Both sprites are will now start to tell the fish joke when the messageFishJoke is broadcast. New jokes can easily be added in as long as a dif-ferent name is given for each joke.

The Stage will be used to broadcast messages about which joke to tell.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Tell the first joke.

1. Select the Stage. We’ll usethe Stage to control the tellingof jokes.

4. Add in a percussion soundafter the joke by selecting thesound tab for the stage.

2. Enter the script asshown, using the broad-cast FishJoke and waitcommand.

3. Run your program byclicking on the greenflag.

5. Use the Import button andselect a sound from the Per-cussion section.

6. Add a play soundcommand to thestage script.

7. Run your program byclicking on the greenflag.

Scratch is a project of the Lifelong Kindergarten Group at the MIT Media Lab and is available to download at scratch.mit.eduTutorial produced by Jean Bodycote([email protected]) and Margaret Low ([email protected])

Adding new jokes.

1. Select the second sprite.

4. Enter this script for thefirst sprite, selecting Knock-Joke for the message name.

Note:

New jokes can now be easily add-ed.

Simply give the joke a name, andcreate an appropriately namedscript for each sprite.

Alter the Stage script to add in abroadcast command for the newjoke.

2. Enter the script as shown—itsgoing to be a Knock Knock joke soenter the name KnockJoke formessage name.

3. Select the first sprite

5. Update the stage script tocall this newj oke.