Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
2Activity
0 of .
Results for:
No results containing your search query
P. 1
Meet Thirsty - String Operator in Scratch

Meet Thirsty - String Operator in Scratch

Ratings: (0)|Views: 3,936|Likes:
Published by Jessica Chiang
A chapter in a new Scratch Project E-Book in progress. To download the demo project, please go to my site: http://shallwelearn.com
A chapter in a new Scratch Project E-Book in progress. To download the demo project, please go to my site: http://shallwelearn.com

More info:

Published by: Jessica Chiang on Sep 30, 2009
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

05/11/2014

pdf

text

original

 
Meet Thirsty: String Operator inScratch
In this post, we will learn to use the string and the list features in Scratch. In thespirit of Shall We Learn, I will show you in a project. This project is called
I AmThirsty
. We will create a stick figure sprite as our main sprite; we will also a drinksprite. You can help this poor thirsty guy by moving the drink sprite to him with yourmouse. Then we will create many drink sprite based on the first drink sprite.First, create a new project and create a new sprite. If you don’t know how to do this,I recommend reading at least the first four lessons of Scratch Programmingavailable on this site.Name this sprite
Thirsty 
. Here is mine. To demonstrate how to use the new
string
features in Scratch, let’s create avariable to hold the result string of adding all the names of the drinks he hasconsumed.Click the orange Variables button at the left panel and click
Make a variable
button. Enter “drink list” as the list name and keep this list visible for all sprites. Then click OK.
 
Create a broadcast message called “consumed”. This broadcast message will besent by the drink sprites later.Create scripts as shown below.
Thirsty
sprite sets
drink list
variable to an emptystring when the game starts, then it waits for the
consumed
broadcast message.Each time a consumed broadcast message is received, it says what’s in
drink list
variable for 2 seconds.Let’s move on to the drink sprite. Create a sprite or get one from Scratch library,and rename it to “tea”.
 
Select
tea
sprite’s Scripts tab, and create a
local variable
named “name”.Create the scripts as shown below. Note that you need to add a empty space beforethe “tea” so the result concatenated string looks right.

Activity (2)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->