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

#1 2010-07-07 20:56:27

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

The anatomy of a Scratch block.

This is not written as or intended to be a tutorial. It is simply for the purpose of showing how Scratch blocks work. It may be used as anything the reader want's it to be, but it is not intended to be a tutorial.

------------------------------------------------------------------------

This post will explain the anatomy of a Scratch block. For the purposes of this, I will be using the http://img815.imageshack.us/img815/721/ifthenblock.png block.

------------------------------------------------------------------------

Every block begins with a method. This tells the block what to do. Without this, the block would do nothing at all. Here is an explanation of how the method works:

http://img651.imageshack.us/img651/6718/blockmethod.png

------------------------------------------------------------------------

But that isn't enough! For a block to actually show up, you need the blockspec for it. Here is an explanation of how the blockspec works:

http://img138.imageshack.us/img138/4915/blockspec.png

------------------------------------------------------------------------

So that's the anatomy of a Scratch block.

Last edited by ScratchReallyROCKS (2010-07-20 10:22:37)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#2 2010-07-08 17:15:58

Aidan
Scratcher
Registered: 2007-06-15
Posts: 1000+

Re: The anatomy of a Scratch block.

Wait, if <> then <> isn't even a real block!

Offline

 

#3 2010-07-08 19:17:09

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: The anatomy of a Scratch block.

Aidan wrote:

Wait, if <> then <> isn't even a real block!

That's the point.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#4 2010-07-08 21:41:41

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

Aidan wrote:

Wait, if <> then <> isn't even a real block!

It doesn't matter. Most of the other scratch blocks are pretty complicated, so I made a simple one.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#5 2010-07-15 13:41:00

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

I think this is a good thread so I'm going to BUMP it  tongue


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#6 2010-07-15 13:49:52

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: The anatomy of a Scratch block.

ScratchReallyROCKS wrote:

I think this is a good thread so I'm going to BUMP it  tongue

Very humble,


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#7 2010-07-15 14:11:53

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: The anatomy of a Scratch block.

I think this is a Extremely well documented description of the blockspec layout, I have linked it in my block library thread.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#8 2010-07-15 14:27:57

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

sparks wrote:

I think this is a Extremely well documented description of the blockspec layout, I have linked it in my block library thread.

Thanks! I worked hard on this.

Last edited by ScratchReallyROCKS (2010-07-15 14:28:21)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#9 2010-07-15 16:02:47

johnnydean1
Scratcher
Registered: 2010-02-12
Posts: 1000+

Re: The anatomy of a Scratch block.

Mistake, when you look at the green bacgrond pic you spelt 'then' wrong  wink


You can now reach me on Twitter @johnnydean1_

Offline

 

#10 2010-07-15 16:07:20

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: The anatomy of a Scratch block.

Could you make that into a real block? It'd be nice to be able to set variables by just pulling them out of the palette  yikes


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#11 2010-07-15 17:28:49

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

johnnydean1 wrote:

Mistake, when you look at the green bacgrond pic you spelt 'then' wrong  wink

Shhhhh......  tongue  (Yeah, I noticed that, but I was too lazy to change it.)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#12 2010-07-19 22:56:19

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

bump


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#13 2010-07-20 00:07:49

meowmeow55
Scratcher
Registered: 2008-12-24
Posts: 1000+

Re: The anatomy of a Scratch block.

Sunrise-Moon wrote:

Could you make that into a real block? It'd be nice to be able to set variables by just pulling them out of the palette  yikes

The blockspec and all the coding is in the screenshots, what more do you want?  tongue  (except you need to change "than" to "then" in the method coding)


Yawn.

Offline

 

#14 2010-07-20 10:22:55

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: The anatomy of a Scratch block.

meowmeow55 wrote:

Sunrise-Moon wrote:

Could you make that into a real block? It'd be nice to be able to set variables by just pulling them out of the palette  yikes

The blockspec and all the coding is in the screenshots, what more do you want?  tongue  (except you need to change "than" to "then" in the method coding)

I fixed it.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#15 2011-03-29 18:53:59

gamer_6
Scratcher
Registered: 2010-07-20
Posts: 20

Re: The anatomy of a Scratch block.

how do you add the blocks to scratch???

Offline

 

#16 2011-03-30 03:43:20

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: The anatomy of a Scratch block.

gamer_6 wrote:

how do you add the blocks to scratch???

Add the block spec to "blockspecs" method after a word, e.g. 'operators' or 'operator' with the single-quotation marks and add the function to be called at the [something] ops. Control block and Motor block function go in the other ops. The [something] depends on the category you choose the block to go in.

Offline

 

#17 2012-04-15 23:38:48

pjtnt11
Scratcher
Registered: 2011-08-13
Posts: 12

Re: The anatomy of a Scratch block.

i figgered out there is blockspec and code... WERE DO YOU PUT THE CODE!!!
because i want more blocks not just boring blocks like|
                                                                            \/

when gf clicked
think [i hate the blocks on scratch and i want more]

Last edited by pjtnt11 (2012-04-15 23:45:10)

Offline

 

Board footer