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

#1 2009-10-11 11:06:48

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

New Blocks

This is a place where you can post new blocks you have made and the code you used to make the block.
I will start.
One block I have made is a replacement for the comment block in scratch 1.2.1.
Add to Scratch-Objects -> ScriptableScratchMorph -> blockSpecs -> class -> blockSpecs:

Code:

('comment %s' #c #commentLoopBlock)

Add to Scratch-Execution Engine -> ScratchProcess -> Instance:

Code:

commentLoopBlock 
      | t1 |
       t1 <- stackFrame expression.
       self popStackFrame.
       self pushStackFrame: (ScratchStackFrame new expression: t1 firstBlockList)

This block will execute the contents of the c-shaped block, and you can comment on the contents of the block too.

By the way, please only comment if you are either complimenting someone's block or posting your own block. If you are going to say something like 'That blocks sounds cool, but you can do this instead with other blocks: ...' please do not comment

Last edited by rubiks_cube_guy238 (2009-10-18 21:05:02)


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#2 2009-10-11 17:08:55

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: New Blocks

Very interesting  smile  I don't have the source code so I wouldn't be able to test them, but they do sound very interesting, though I'm not quite sure of the purpose of a comment block when we already have comments...

Offline

 

#3 2009-10-11 19:28:23

gershmer
Scratcher
Registered: 2009-02-12
Posts: 1000+

Re: New Blocks

coolstuff wrote:

Very interesting  smile  I don't have the source code so I wouldn't be able to test them, but they do sound very interesting, though I'm not quite sure of the purpose of a comment block when we already have comments...

The source code is available for download on the website...
and the advantage of the comment block is that it attaches into a script as a block.


Visit my site, Gershmer.net
Leave me a voicemail at my Google Voice number, [removed]

Offline

 

#4 2009-10-11 21:24:05

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: New Blocks

gershmer wrote:

coolstuff wrote:

Very interesting  smile  I don't have the source code so I wouldn't be able to test them, but they do sound very interesting, though I'm not quite sure of the purpose of a comment block when we already have comments...

The source code is available for download on the website...
and the advantage of the comment block is that it attaches into a script as a block.

Thanks  smile
And I guess the advantages are true... but in 1.4 you can attatch the comments to blocks, which works great for me.

Offline

 

#5 2009-10-12 14:21:07

rubiks_cube_guy238
Scratcher
Registered: 2009-07-02
Posts: 100+

Re: New Blocks

coolstuff wrote:

Very interesting  smile  I don't have the source code so I wouldn't be able to test them, but they do sound very interesting, though I'm not quite sure of the purpose of a comment block when we already have comments...

You can get the scratch source code  here.


The glass is never half full nor half empty; it is twice as large as it needs to be.

Offline

 

#6 2009-10-12 14:49:56

dav09
Scratcher
Registered: 2009-03-25
Posts: 1000+

Re: New Blocks

yes and the 1.4 source was released recently

Offline

 

Board footer