This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-03-08 16:59:56

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

The Blocks of Scratch

Hey Everyone,

So first off I would like to thanks Paddle2See and Lucario621 on the variable part of the post. You are all probably wondering what this is, this is a tutorial of the Scratch Blocks. I have divided this post into 7 parts. Here are the parts:

1. Controlling the Blocks

2. The look of the Sprite

3. Moving Around

4. How it Sounds

5. Drawing (pen block)

6. Operating

7. The Variables


So this is the first Chapter:

Controlling the Blocks

Every script has one of these. These blocks control the entire script. Whether you want to make your sprite turn forever, or turn just ten times. One block that every script must have is the "When Greenflag Clicked" script. It looks like this:

when gf clicked
It basically means that when the green flag is clicked, something will happen.
Another script that I mentions above is the forever block. This makes your block do a specific thing "forever". Here is what the Scratch block looks like:
forever
end
The last block I am going to talk about in the Control section is the "Broadcast" button. It is hard to explain the Broadcast button. So I will give an example:
when gf clicked
repeat until <(timer) > [10]>
  go to [mouse-pointer v]
end
broadcast [move v]


when I receive [move v]
wait (1) secs
And now I will move on the Chapter 2.


The Look of the Sprite
Here I will talk about what the sprite will look like. This can mean anything. One block is the "switch to costume [costume2 v]" block. A costume is the two different looks of the sprite. So if I have a switch to costume 2 block, then the sprite will switch to whatever you costume2 is. Here is what the block looks like:
switch to costume [costume2 v]
Another look block I will talk about is the "say hello for 2 secs" button. This makes your sprite say hello for 2 seconds. Here is what the block looks like:
say [hello] for (2) secs
The last block I am going to talk about is the "Show and Hide" blocks. These blocks make your sprite either show/hide. This is what the block looks like:
show

hide
Moving Around
A lot of Scripts have these kind of blocks. These blocks will make your sprite move to a specific place. One block lets your sprite glide to a specific place. This is what the block looks like:
glide (1) secs to x: (0) y: (0)
Another block lets your sprite change x where ever it is. This is what the block looks like:
change x by (10)
The last block I want to talk about it the go to block. This block makes a specific sprite move to a specific place. This is what the block looks like:
go to x: ( ) y: ( )
How it Sounds
In this chapter I will be talking about sounds in Scratch. Sounds are very easy to do in Scratch. One block is the play sound block. This play’s a specific sound. This is what the block looks like.
play sound [meow v]
There is not much to this chapter but whatever.


Drawing (pen block)
The pen block allows somebody to control the pen in scratch. One of the blocks is the pen up block. This block acts like a when green flag clicked block. It starts the pen. The pen down block does the opposite. This is what the block looks like:
pen down

pen up
The second and last block in this chapter is set pen color to []. This does what it seems like it does, it sets the pen color. This is what the block looks like:
set pen color to [ ]
That is the end of the chapter.


Operating
The operating blocks sort of explain there self. Though these are not normal blocks, you have to drag these blocks into another block. For example:
if <[] = []>
   Script goes here
End
Another block is the not block. This block means what it looks like.
if  <not < >>
  script goes here
end
That is the end of this section.

Varibles
This is what Paddle2See said.
Variables are a way to store numbers or words.  When you create a variable and give it a name, you have created a place in the computer that can remember things for you.  You use the name to get at the contents of it (kind of like your home address gets you to your mailbox).  You can change the contents using the "Set Variable to" block.  

So what do we use variables for?  Well, lots of things, but these are the typical uses:


1) To remember something that happened in one part of the program for use later in the program.  



2) To communicate between different sprites (usually by making the variables "For all sprites" meaning all sprites can see their values and change them)



3) To make it so that you can set a value one place...and then use it in many places, like the speed of a sprite.
Here are some examples:
when gf clicked
set [score v] to [0] //The score goes back to 0 each time you play.
forever
if <touching [coin v]?>
change [score v] by [1] //The score increases when you get a coin!

when I receive [game over v] //This tells you your score.
say (join [Your score was ] (join (score) [. Good job!]))
Okay everyone, that are the blocks of Scratch, please leave suggestions below on how to improve something or if something is not right.

Thanks!
Scratch On!

Last edited by joletole (2012-03-09 18:21:14)

Offline

 

#2 2012-03-08 17:04:04

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

Anyone can make suggestions.

Offline

 

#3 2012-03-08 17:16:56

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: The Blocks of Scratch

isn't this another thread you've made that already exists elsewhere? sorry if i keep pestering you about this, but I think this is the third thread you've made which is in some-way a replica of something else.

I have seen a page with all of this on before.


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#4 2012-03-08 17:20:08

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

Borrego6165 wrote:

isn't this another thread you've made that already exists elsewhere? sorry if i keep pestering you about this, but I think this is the third thread you've made which is in some-way a replica of something else.

I have seen a page with all of this on before.

Oh, okay...

Offline

 

#5 2012-03-08 18:44:27

Pitusky12
Scratcher
Registered: 2011-09-21
Posts: 500+

Re: The Blocks of Scratch

Someone Should Make BYOB


Scratch 2.0 Beta Tester  wink

Offline

 

#6 2012-03-08 18:56:03

mewkid
Scratcher
Registered: 2010-08-16
Posts: 100+

Re: The Blocks of Scratch

Awesome guide!  big_smile  I would image this would be helpful to a lot of people. I couldn't even find the 'not' script when I started scratch  tongue  I was only nine years old, but still...

Offline

 

#7 2012-03-09 06:43:09

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

anyone

Offline

 

#8 2012-03-09 08:46:10

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: The Blocks of Scratch

Good job! For the Controlling part of the tutorial, you might want to use <(timer) > (10)> instead of <(timer) > [10]> just to keep it more clean.  smile

Offline

 

#9 2012-03-09 16:03:23

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: The Blocks of Scratch

Another thing, not only does this exist as I've already mentioned, but it has far more example-scripts too.


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#10 2012-03-09 16:15:43

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

Borrego6165 wrote:

Another thing, not only does this exist as I've already mentioned, but it has far more example-scripts too.

Put a link to this thread and let me see it.

Offline

 

#11 2012-03-09 18:50:38

JabberJay
New Scratcher
Registered: 2012-03-05
Posts: 75

Re: The Blocks of Scratch

Amazing guide! The content is very useful and helpful!  big_smile

Offline

 

#12 2012-03-09 18:51:33

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

JabberJay wrote:

Amazing guide! The content is very useful and helpful!  big_smile

Thanks!

Offline

 

#13 2012-03-09 21:27:36

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

bump

Offline

 

#14 2012-03-09 21:42:48

turkey3
Scratcher
Registered: 2011-12-04
Posts: 500+

Re: The Blocks of Scratch

Helpful guide, but I already knew it all.  tongue

Offline

 

#15 2012-03-10 02:21:38

Borrego6165
Scratcher
Registered: 2011-03-10
Posts: 1000+

Re: The Blocks of Scratch


Generation:4001 Build a beautiful city, with over 50 objects and over 10000 tiles per city! This simulates traffic, pollution, tourism, crime and more!

Offline

 

#16 2012-03-10 02:25:10

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: The Blocks of Scratch

hmmm  corection all scrips need hat block you said they need

when flag clicked
d

but they could use brodcast or key hats


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#17 2012-03-10 07:06:14

PullJosh
Scratcher
Registered: 2011-08-01
Posts: 500+

Re: The Blocks of Scratch

I'm making a site for new scratchers. Could I link to this?


http://www.blocks.scratchr.org/API.php?action=text&amp;string=I'm_on_vacation!&amp;xpos=155&amp;ypos=90&amp;font_size=30&amp;bgimage=http://imageshack.us/a/img339/7215/sspeechsigapiforwords.png

Offline

 

#18 2012-03-10 07:36:22

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

PullJosh wrote:

I'm making a site for new scratchers. Could I link to this?

Sure!

Offline

 

#19 2012-03-10 07:37:22

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

Borrego6165 wrote:

Here!

Oh, well some new Scratchers don't know how to get to the Wiki.

EDIT: I had no idea the Wiki existed until last weekend.

Last edited by joletole (2012-03-10 07:52:46)

Offline

 

#20 2012-03-10 07:59:27

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: The Blocks of Scratch

joletole wrote:

Borrego6165 wrote:

Here!

Oh, well some new Scratchers don't know how to get to the Wiki.

EDIT: I had no idea the Wiki existed until last weekend.

You've made a very nicely-formatted basic guide to the various blocks - thanks for your efforts!

But maybe the Wiki is a better place to put material like this, since it has better formatting and structuring capabilities and a more stable future during the Scratch 2.0 transition.  Have you got a Wiki account yet?  They can always use a few more helpful Scratchers  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#21 2012-03-10 08:01:25

joletole
Scratcher
Registered: 2011-02-20
Posts: 1000+

Re: The Blocks of Scratch

Paddle2See wrote:

joletole wrote:

Borrego6165 wrote:

Here!

Oh, well some new Scratchers don't know how to get to the Wiki.

EDIT: I had no idea the Wiki existed until last weekend.

You've made a very nicely-formatted basic guide to the various blocks - thanks for your efforts!

But maybe the Wiki is a better place to put material like this, since it has better formatting and structuring capabilities and a more stable future during the Scratch 2.0 transition.  Have you got a Wiki account yet?  They can always use a few more helpful Scratchers  smile

Oh, I don't have a wiki account. Every time I try to go and request an account for me, It just says the server is down.

Offline

 

Board footer