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 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:
------------------------------------------------------------------------
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:
------------------------------------------------------------------------
So that's the anatomy of a Scratch block.
Last edited by ScratchReallyROCKS (2010-07-20 10:22:37)
Offline
Wait, if <> then <> isn't even a real block!
Offline
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.
Offline
ScratchReallyROCKS wrote:
I think this is a good thread so I'm going to BUMP it
![]()
Very humble,
Offline
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)
Offline
Mistake, when you look at the green bacgrond pic you spelt 'then' wrong
Offline
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
Offline
johnnydean1 wrote:
Mistake, when you look at the green bacgrond pic you spelt 'then' wrong
![]()
Shhhhh...... (Yeah, I noticed that, but I was too lazy to change it.)
Offline
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
![]()
The blockspec and all the coding is in the screenshots, what more do you want? (except you need to change "than" to "then" in the method coding)
Offline
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
![]()
The blockspec and all the coding is in the screenshots, what more do you want?
(except you need to change "than" to "then" in the method coding)
I fixed it.
Offline
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
i figgered out there is blockspec and code... WERE DO YOU PUT THE CODE!!!
because i want more blocks not just boring blocks like|
\/
whenclicked
thinki hate the blocks on scratch and i want more
Last edited by pjtnt11 (2012-04-15 23:45:10)
Offline