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

#76 2011-04-04 22:20:42

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

What about the ability to define a block as "For all sprites" or "For this sprite only"?


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#77 2011-04-04 22:39:12

hdarken
Scratcher
Registered: 2008-06-26
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

Awesome!


http://i.imgur.com/VskBk.png
http://i.imgur.com/tgxVZ.jpg

Offline

 

#78 2011-04-04 23:13:18

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

fullmoon wrote:

What about the ability to define a block as "For all sprites" or "For this sprite only"?

bbbeb wrote:

IMO it should be like
[ [block here] as [ v]]

whereas the dropdown says:

private (or for this sprite)
public (or global)

That would fit well.

tongue


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#79 2011-04-05 08:04:35

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

bbbeb wrote:

fullmoon wrote:

What about the ability to define a block as "For all sprites" or "For this sprite only"?

bbbeb wrote:

IMO it should be like
[ [block here] as [ v]]

whereas the dropdown says:

private (or for this sprite)
public (or global)

That would fit well.

tongue

Yeah, I figured someone had probably suggested it already! But your post makes it look like you're proposing some sort of block. I think that block scope should be chosen the same way you choose variable scope, in a dialog. But now I'm thinking in terms of BYOB; it doesn't look like there will be a block dialog in 2.0.


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#80 2011-04-05 12:21:51

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Scratch 2.0 Progress Report: Create your own block

In the prototype that Lightnin described, a user-defined block is constructed in the scripting area of a specific sprite. There are three good things about this approach.

First, it supports a bottom-up approach to building a block: the user first creates a useful stack, then turns it into a block. One can also define blocks in a top-down manner (i.e. start with block definition hat and add blocks to it), but the bottom up approach provides a natural learning path: one first learns about individual command blocks, then how to make stacks of blocks, and finally how to turn a stack into a user-defined block. The final step -- adding a procedure definition hat to an existing stack of blocks -- is done in the familiar context of the scripts pane.

Second, defining a block in the context of a specific sprite allows it to be incrementally tested and debugged. One can click on the block definition to run it, just like any other stack of blocks, and observe what the sprite does as a result.

Third, defining blocks in the context of a sprite means that all the sprite blocks are available in the palettes. In contrast, if blocks were defined in the context of the stage, the stage's command palette lacks sprite-specific blocks such as the motion blocks. One might worry that defining blocks in the context of a sprite means that stage-specific blocks could not be used. Fortunately, all the stage commands are available in the sprite palettes, although a few operations have different names (e.g. "next costume" vs "next background").

So, there are many good things about the process of defining a block in the context of a specific sprite. However, once defined, a (global) block can be used by *any* sprite. When viewing an unfamiliar project, where should a user look to find block definitions? That's the question we've been puzzling over, and for which many of you have offered excellent suggestions (thanks!). Your suggestions include the stage, a "definitions" area just for user-defined block definitions with a thumbnail below the stage, and an additional tab in addition to scripts/costumes/sounds. My own current favorite is a sort of "drawer" that opens up from the bottom (footer) of the scripts pane, first suggested by webstermath. This would allow blocks to be dragged between the scripts pane and the procedure definitions drawer. But that's just my opinion; the Scratch team will continue to think about (and debate) this issue.

Thanks again all the great ideas!

Offline

 

#81 2011-04-06 17:57:41

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

Re: Scratch 2.0 Progress Report: Create your own block

headfones wrote:

Wow that's awesome
I could make my whole huge timer system into one block

Wait --- don't! It actually adds more data to the project. The project needs the code to run custom blocks and it's scripts!

Offline

 

#82 2011-04-08 00:15:23

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

Lightnin wrote:

For one thing, it's nice to be able to see the custom block and its definition scripts on the same screen.

Hi, Lightnin!  Sorry I've been busy for a while and got three pages behind on this thread.  sad

I'm not really sure why you and John put so much emphasis on seeing the block in the palette and seeing the definition at the same time.  First, you can do that with a separate block editor window; it doesn't hide the palette.  Second, the whole idea of putting the block prototype in the hat block is that it looks like the block!  (I think that should be even more true than it currently is in BYOB; when we next have time for UI details I think we should have the orange formal parameter blobs be rectangular, rounded, hexagonal, etc., to match the input type.  We already show the default value, if there is one, along with the formal parameter.)  So when you're looking at the definition you already see the block.

One related question we discussed with you guys a long time ago is whether a custom block in the palette should be marked as custom.  I lean toward not marking them; the pedagogic point is that custom blocks, once made, can be used exactly like a primitive block.  But if you want to mark them (as John did in that conversation iirc), you can mark them with a button that brings up the definition.

But this brings up questions  - like: Should custom blocks be "global" (i.e. all "Jump" blocks are the same across the entire project. If you change one, you've changed them all) or "local" to the sprite (each sprite can have their own unique "jump" block).   And of course: where should the script definition live?

i.e. If I make a scratch project with gobo and Scratch cat in which both use "jump" but the definition of jump lives in the cat, what happens when I export the gobo sprite? Does it just get a copy of the jump definition? What happens if I make changes to the jump definition in Gobo and then import it back to the same project - then you have a conflict between the definitions of Jump on Gobo and on the Jump on Scratch Cat (assuming everything is global).  Actually, that's making me think we should have the concept of global / local: It's better to try to explain that concept than to have people try to merge different definitions for custom blocks when importing sprites. Does BYOB have a way of addressing that kind of conflict?

We do distinguish "for all sprites" and "for this sprite only," the same as for variables.  It's an idea that Scratchers already understand.  However, we export global as well as local custom blocks when exporting sprites.  (This is useful because we can use an exported sprite as the carrier of a block package, like the ToolSprite we include with BYOB.)  I'm afraid that in case of a conflict, the one loaded second wins silently.  Probably we should give some kind of warning -- but as I understand it, part of the Scratch design philosophy is to avoid error/warning messages as much as possible.

If we invented a different way to export block packages, maybe it would make sense for an exported sprite to include only its local blocks.  But then you have the opposite problem; what if a sprite uses a global custom block, and is imported into a project that doesn't have such a block?

This gets even more interesting when you can clone sprites.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#83 2011-04-08 00:19:07

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

johnm wrote:

But you can do a surprising amount with only command blocks, including recursion and even functions (by using a global variable for the return

But that doesn't work for recursive functions!  And anyway, it makes for ugly programs.  Imho.


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#84 2011-04-08 00:28:21

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

johnm wrote:

I should mention that user-defined reporters have impacts performance and the concurrency mechanism, so there are some technical reasons to not include that feature in Scratch 2.0.

... as I discovered to my dismay in BYOB!  But, John, other languages don't have this problem -- it's just a result of your (as Jens keeps telling me  smile  ) brilliant (but very unusual) design for the evaluator.  When we rewrite BYOB this summer the evaluator will be independent of the GUI code and recursive reporters will be fast.  And you're rewriting the evaluator, too, so you could address the speed problem.

Not trying to pick a fight; you also have pedagogic reasons not to want custom reporters in 2.0, and that's what's important.  Just picking a nit.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#85 2011-04-08 07:41:23

fullmoon
Retired Community Moderator
Registered: 2007-06-04
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

bharvey wrote:

johnm wrote:

I should mention that user-defined reporters have impacts performance and the concurrency mechanism, so there are some technical reasons to not include that feature in Scratch 2.0.

... as I discovered to my dismay in BYOB!  But, John, other languages don't have this problem -- it's just a result of your (as Jens keeps telling me  smile  ) brilliant (but very unusual) design for the evaluator.  When we rewrite BYOB this summer the evaluator will be independent of the GUI code and recursive reporters will be fast.  And you're rewriting the evaluator, too, so you could address the speed problem.

Just out of curiosity, what is it that makes reporters so expensive?


http://i302.photobucket.com/albums/nn100/fullmoon32/wow.jpg

Offline

 

#86 2011-04-09 01:56:07

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

fullmoon wrote:

Just out of curiosity, what is it that makes reporters so expensive?

I should really leave this for Jens or John to answer, but I think the general answer is that one of the design principles of Scratch is that everything that happens should happen visibly.  This works out okay for Scratch, in which scripts are very command-heavy, and many of the commands make something happen on the stage, so it's okay that their evaluation is closely tied to displaying.  But when you start writing recursive reporters, you really want the evaluation to happen without being tied to the display of the blocks or the data.  Jens singles out what Scratch misleading calls "single stepping" (really it's slow stepping) because every step in the evaluation lights up a different block, and the evaluator thinks about doing that even when you're not single stepping.

But eventually J or J will read this and give you an authoritative answer.  smile


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#87 2011-04-09 02:17:26

14God
Scratcher
Registered: 2008-11-14
Posts: 100+

Re: Scratch 2.0 Progress Report: Create your own block

bbbeb wrote:

Perfect. Like defining a procedure in C++. Absolutely perfect for those who want to transition into real coding.

Scratch has been behind, no serious mid-high level language lacks functions, and from the looks of it they're not providing a way to make reporter blocks either. Maybe some lack of features is a way of kicking advanced users 'out of the nest' to go on to serious typed languages.

Last edited by 14God (2011-04-09 02:26:10)


http://cs.berkeley.edu/~bh/sig4.png
Logic and reason have led me to atheism... but I'm stuck with the name  tongue

Offline

 

#88 2011-04-09 22:53:30

bharvey
Scratcher
Registered: 2008-08-10
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

14God wrote:

serious typed languages.

Do you mean typed as in typewriter, or typed as in unsigned int?  (If the latter, we have to have a discussion.  smile  )


http://cs.berkeley.edu/~bh/sig5.png

Offline

 

#89 2011-04-10 19:34:39

scratch256
Scratcher
Registered: 2011-02-18
Posts: 18

Re: Scratch 2.0 Progress Report: Create your own block

I can't wait for 2.0!
I can imagine it right now...


My first scrolling game is out!

Offline

 

#90 2011-04-10 20:36:46

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

I think you should have just the basic blocks in the Standard Scratch version and then have a block download page. But make it simple like when you download add-ins for Firefox or Google Chrome. Do you know what I mean? I would be great if you did [show list] and [hide list] blocks as well as [go to x(value) y(value] for variables. Also could you make interactions between sprites so sprites have children sprites that move in relation to the parent sprite (useful for wheels on cars and props on planes and stuff).

Hope this helps!


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#91 2011-04-14 15:54:41

gbear605
Scratcher
Registered: 2008-03-06
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

I hope there is a beta for this at scratchday.  Also, do you think you will be sharing the sourcecode for it??  Lastly, will there be mesh??


Yeah, I'm mostly inactive.  I check in once in a while though.  If you want to contact me, I have a contact form at my website, http://escratch.org

Offline

 

#92 2011-04-16 10:19:19

V360
Scratcher
Registered: 2010-11-08
Posts: 18

Re: Scratch 2.0 Progress Report: Create your own block

What happens when other people open your project?  yikes  Does the block split into its scripts?
Maybe there could be an option to add the block to a "Block Pile" Menu.

Lightnin wrote:

Here's the latest: HAD TO REMOVE

Check it out, and then join in the discussion about the best way to do 'Create your own block' in Scratch 2.0 here:

Create your own block blog post wrote:

We’re still in the process of figuring out the best way for Scratchers to create their own blocks, and there are still many questions. For example, if you create a jump block in one sprite, would other sprites be able to use the jump block too? Should the definition script appear in only one sprite -- and, if so, how would people find it? Should you be able to define “jump” differently in different sprites? These are few of the questions we have to think through before we’re ready to put this cool feature in the next version of Scratch.


~V360
http://i.imgur.com/VeLyVmB.png

Offline

 

#93 2011-04-16 11:18:49

Enzo1997
Scratcher
Registered: 2008-06-14
Posts: 500+

Re: Scratch 2.0 Progress Report: Create your own block

My Reaction:
-This seems much like BYOB, maybe you could create a feature to transport blocks to Scratch from BYOB or vice versa.
-There should be some way to get user-made blocks off the net.
-This would hugely up my efficiency, as I remake scripts often.
-Will Panther-esce features be added?


Your music tastes are bad, therefore your argument is irrelevant.

Offline

 

#94 2011-04-16 23:26:48

Venazard
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: Scratch 2.0 Progress Report: Create your own block

Yeah, like the idea of a block store someone suggested in the new ideas page.


http://nitrostudios.weebly.com/uploads/6/8/1/2/6812574/1323469851.png

Offline

 

#95 2011-04-18 16:42:24

williambl
Scratcher
Registered: 2011-04-08
Posts: 100+

Re: Scratch 2.0 Progress Report: Create your own block

I have started making a mockup! When i'm finished I will post it.


http://internetometer.com/imagesmall/34650.png
http://www.danasoft.com/sig/Epicnesssign.jpg

Offline

 

#96 2011-04-20 20:24:28

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Scratch 2.0 Progress Report: Create your own block

So this fleshes out the broadcast function?  Great!  Can't wait for the new release of 2.0!

Offline

 

#97 2011-04-20 21:35:05

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

amcerbu wrote:

So this fleshes out the broadcast function?  Great!  Can't wait for the new release of 2.0!

The broadcast function is staying. If you don't like it, don't use it.


~ihaveamac - visit ihaveamac.net

Offline

 

#98 2011-04-21 12:45:38

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Scratch 2.0 Progress Report: Create your own block

ihaveamac wrote:

amcerbu wrote:

So this fleshes out the broadcast function?  Great!  Can't wait for the new release of 2.0!

The broadcast function is staying. If you don't like it, don't use it.

The ability to create procedures will do everything that the broadcast function does already, and more.  Maybe it will stay, but it is no longer needed.  What I meant by "fleshes out" is "expands."

Offline

 

#99 2011-04-21 13:38:30

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Scratch 2.0 Progress Report: Create your own block

amcerbu wrote:

ihaveamac wrote:

amcerbu wrote:

So this fleshes out the broadcast function?  Great!  Can't wait for the new release of 2.0!

The broadcast function is staying. If you don't like it, don't use it.

The ability to create procedures will do everything that the broadcast function does already, and more.  Maybe it will stay, but it is no longer needed.  What I meant by "fleshes out" is "expands."

How?

Offline

 

#100 2011-04-21 17:06:53

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Scratch 2.0 Progress Report: Create your own block

scimonster wrote:

amcerbu wrote:

ihaveamac wrote:

The broadcast function is staying. If you don't like it, don't use it.

The ability to create procedures will do everything that the broadcast function does already, and more.  Maybe it will stay, but it is no longer needed.  What I meant by "fleshes out" is "expands."

How?

According to the progress report, procedures will be carried out by "custom blocks."  The procedure itself is stored somewhere else in the code, and by running it, the program calls on that particular section of code.  Not only can procedures be run from another place (like broadcasts), they can also take arguments.  This completely eliminates the need for a broadcast block at all.

Offline

 

Board footer