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

#1 2012-07-21 08:34:05

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Scratch code to Scratch block.

Hey guys, quick question, I was wondering if any advanced programmer would be will to create a GUI to create [-scratchblock-] codes, like scratch, it would click together, and you could convert it to text, this would be very useful.
I mainly need this because I can help people with codes, but I can't use scratchblocks correctly  tongue .
Thanks
Dan


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#2 2012-07-21 08:55:31

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch code to Scratch block.

Hi Dan,

This looks like honestly much more work than it's worth. There is, however, a really cool cheat in Scratch. Open up Scratch, write your script, then shift-click the file menu and select Write Project Summary. Then choose a file path. Open up the shiny new txt file you get, and you'll see a section with your script in a format pretty close to scratchblocks format to work relatively right. You can of course tweak it afterwards.

Here's a sample summary-generated code you can see:

Code:

 when green flag clicked
        forever  
            if ((x position) < (y position)) else 
                reset timer
            else
                turn  15 degrees
    end

 when green flag clicked
        forever  
            if ((x position) < (y position)) else 
                reset timer
            else
                turn  15 degrees
    end
As you can see, it's not perfect, but it gets you started. And it's just plain really cool in a way. Enjoy!  smile

Last edited by Hardmath123 (2012-07-21 08:56:13)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2012-07-21 10:25:18

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Scratch code to Scratch block.

Omg! that is awesome, thanks alot Hardmath123 this will be really useful  big_smile  Now i might be helpful on these forums  tongue  Thanks!
Dan


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#4 2012-07-21 12:39:46

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Scratch code to Scratch block.

You're welcome. I ought to put this up on the Wiki.


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5 2012-07-21 13:28:59

blob8108
Scratcher
Registered: 2007-06-25
Posts: 1000+

Re: Scratch code to Scratch block.

There's a script included with Kurt that exports all the scripts (and images) in a project to scratchblocks format. Just point it at a Scratch project file (.sb), and it does exactly this for you  smile


Things I've made: kurt | scratchblocks2 | this cake

Offline

 

#6 2012-07-21 13:58:42

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch code to Scratch block.

I am also working an a Scratch plugin that automatically gives you scratchblocks code when you select an option from right clicking a script. Stay tuned in a couple weeks for more updates  tongue

Offline

 

#7 2012-07-21 21:09:09

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: Scratch code to Scratch block.

Thanks guys  big_smile  The plugin would be awesome  smile


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#8 2012-07-22 09:45:32

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: Scratch code to Scratch block.

daniel_j wrote:

Thanks guys  big_smile  The plugin would be awesome  smile

The plugin has been made  smile  See http://scratch.mit.edu/forums/viewtopic.php?id=102175

Offline

 

Board footer