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

#2401 2011-01-16 16:18:22

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

Re: BYOB 3 - Discussion Thread

xly wrote:

"family" (or class) variables

That's a great name suggestion!  Thanks.


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

Offline

 

#2402 2011-01-16 16:27:15

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

Re: BYOB 3 - Discussion Thread

jstout wrote:

I can't say at the moment, make me 75 sprites using this as a prototype without a lot of right click/duplicating?

Oh yes, of course there will be a block to make a clone.

Indeed, I think the Panther people are fundamentally right that everything you can do from the GUI should be doable in a script.  I just want to achieve that without the bazillion new blocks they invented, so am pushing the idea of active variables instead.  But, yeah, don't worry.

Anyway, this is orthogonal to class/instance vs. prototyping!  smile


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

Offline

 

#2403 2011-01-16 16:30:14

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

...bazillion new blocks they invented.

They all have different uses.  big_smile


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

Offline

 

#2404 2011-01-16 16:38:58

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

Re: BYOB 3 - Discussion Thread

bbbeb wrote:

They all have different uses.

Sure.  But, for example, instead of having a block

SET STRETCH TO < >%

and another block

SET VSTRETCH TO < >%

you could just use the regular old SET block and say

SET <_STRETCH> TO < >

This could also potentially replace some of the regular Scratch blocks like

SET X TO < >
SET COSTUME TO < >
SET COLOR EFFECT TO < >

etc.


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

Offline

 

#2405 2011-01-16 19:09:13

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

Hmm, I disagree about the three kinds of variables and blocks ("for all sprites", "for this sprite only", "for this sprite's family"). I think it should start out exactly like it is right now, distinguishing just between global and sprite-local. Once a sprite is instantiated it should replace the "for this sprite only" label with something like "for this sprite and its instances".


Jens Mönig

Offline

 

#2406 2011-01-16 19:43:50

illusionist
Retired Community Moderator
Registered: 2008-07-02
Posts: 1000+

Re: BYOB 3 - Discussion Thread

We need BYOB for Android apps.  big_smile


http://i.imgur.com/8LX1NrV.png

Offline

 

#2407 2011-01-16 20:18:05

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

Re: BYOB 3 - Discussion Thread

Sorry to fill up your weekend, but could people interested in the cloning discussion please also read Henry Lieberman's paper, which I think makes an even better case for my model than the Self paper.  Thanks!


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

Offline

 

#2408 2011-01-16 20:19:47

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

Re: BYOB 3 - Discussion Thread

illusionist wrote:

We need BYOB for Android apps.

Well, this isn't quite BYOB, but it's a big first step: http://www.catroid.org/.


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

Offline

 

#2409 2011-01-16 20:22:21

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

Re: BYOB 3 - Discussion Thread

Jens wrote:

Once a sprite is instantiated it should replace the "for this sprite only" label with something like "for this sprite and its instances".

You mean, once a sprite is instantiated, familial is the only option?  I am trying to let the user control (on a per-variable basis) whether only variable names propagate (instance variables, as in your model) or whether values propagate too (class variables, as in my model).

Last edited by bharvey (2011-01-16 21:04:30)


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

Offline

 

#2410 2011-01-17 05:46:51

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

Jens wrote:

Hmm, I disagree about the three kinds of variables and blocks ("for all sprites", "for this sprite only", "for this sprite's family"). I think it should start out exactly like it is right now, distinguishing just between global and sprite-local. Once a sprite is instantiated it should replace the "for this sprite only" label with something like "for this sprite and its instances".

After further thinking this probably offers no great interest. But this idea came with the stream of the discussion about the idea to introduce a script Make a Variable + a pick-list 1-global 2-local (why not 3-familial and so on).

We should not forget that BYOB already offers a mechanism to store semi-global variables as described by Brian in Tutorial Chap 4. Many property-variables of a sprite or of a family of sprites can be stored in that way ( like nb of hits, initial position, life points, power..). With the experience,  I use a list (or 2 or 3 according the needs) to store these properties-variables, more convenient than to define one variable per property. So the application is not overloaded by a myriad of variables. The property list is adapted to the object family (hero, monster, enemy, weapon etc)

I have a wish  : to have a new  instruction similar to < x position > to get the <name > of a current sprite. This would allow to SET automatically all variables and methods after duplication. The generic Self local variable would be automatically initialized with this name.

Offline

 

#2411 2011-01-17 10:14:16

xly
Scratcher
Registered: 2010-04-17
Posts: 100+

Re: BYOB 3 - Discussion Thread

@ bharvey - ref H. Lieberman paper

There are dozens of OOP languages, more or less successful (compare bibliography to get an idea of their popularity). They mostly address professional applications, mainly design of Web HM Interface with all the usual tinkery of windows, buttons, pick-list etc

This is definitively not the scope of Scratch/Byob which aims at applications that kids/teens like : adventure game, address game, role player game, strategy game, war games etc How implement new features addressing their needs AND helping them to "raise their ceiling" ? How implement new OOP features while keeping the user-friendliness, flexibility, tinkerability, interactivity and pleasure of programming (ouf) ?

Prototyping+delegation is probably better adapted to Byob applications than classes+inheritance. Generally speaking Byob with its the messaging/multiprocessing capabilities is better adapted to event-driven OOP features. For example RP Games uses extensively events to set up the scenarii. (legacy windows HMI as well).
Just an example : have a new <when broadcast received > adapted for a script integration (contrarily to the Hat control having the same function )...

Offline

 

#2412 2011-01-17 11:13:46

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

Re: BYOB 3 - Discussion Thread

xly wrote:

The generic Self local variable would be automatically initialized with this name.

No, no!  You can have a Name variable that's the name, but Self has to be the sprite itself!

They mostly address professional applications, mainly design of Web HM Interface with all the usual tinkery of windows, buttons, pick-list etc

Yes, exactly.  One of the virtues of Henry's paper is that his examples are Logo-related, e.g., how to define a turtle as an object that can be tinkered with and then used as a prototype for all other turtles.  This is directly relevant to the Scratch universe.


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

Offline

 

#2413 2011-01-17 14:02:33

Carl_
Scratcher
Registered: 2009-07-12
Posts: 7

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Carl_ wrote:

The idea is that the jagged list block has the input "all of". That makes it's input the input of the lists. If you press one of the arrows, then it'll get another segment which also has arrows. Basically, it makes sure that you always make a jagged list.

Your "all of" sounds to me exactly like the LIST block. I guess what you/re asking is for BYOB to enforce that a particular input be a list of lists, rather than a list of other kinds of things.

But why do lists of lists deserve special treatment?  There are bunches of blocks that take numbers as inputs, and in order for the operation to be sensible the number has to be a positive integer (like ITEM <> OF <>), but Scratch doesn't provide a special positive integer data type.  If you write a PIGLATIN block that's expecting a word (a text string made of letters) as input, it'll likely do something confusing if given a sentence (a text string including spaces) instead.  But there's no distinguished 'word' data type.

I'm guessing you first learned a strongly typed language such as Java.  The trouble with such languages is that (1) they make it hard to create heterogeneous data structures, like a list whose elements can be of different types; (2) they get the types wrong anyway; "positive integer" is never one of them.

The right approach to typing, if you want to have a typed language, is runtime type checking; you let block definitions attach a predicate function to each input slot, and an error is signalled if the predicate reports false for a given input value.  That way, the user can have "positive integer" as a type, or "jagged list," or "costume that's taller than it is wide," or anything you can imagine.  This is much better than building more and more specific types into the language.

Well, it is a bit like a list block, but it automatically "inserts" the blogs it wants to add, and you can't remove them. Instead you can use the settings that you can use with other block types, like multiple etc. It's not because of typing, but because of for example if/elseif/.../elseif/else blocks. And the input blocks should not have any effect except for packing their input into a list or something.

Offline

 

#2414 2011-01-17 19:15:41

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

Re: BYOB 3 - Discussion Thread

Carl_ wrote:

It's not because of typing, but because of for example if/elseif/.../elseif/else blocks.

We already have a solution for that... look at the SWITCH block in tools.ypr.


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

Offline

 

#2415 2011-01-18 02:26:58

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

Re: BYOB 3 - Discussion Thread

@ bharvey
I think you should make a toggle advanced blocks button in the options palette so that newcomers would not be scared off but 'oldcomers' could be appeased too by more advanced and fast native blocks.

Last edited by 14God (2011-01-18 02:28:33)


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

Offline

 

#2416 2011-01-18 09:51:59

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

Re: BYOB 3 - Discussion Thread

14God wrote:

@ bharvey
I think you should make a toggle advanced blocks button in the options palette

There's a discussion going on in the Scratch suggestions about this very idea.  The argument against it is that it'll be confusing if you download a project that uses blocks that aren't in your palette.

I think we should wait to see what the Scratch Team decide on this one and follow their lead.


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

Offline

 

#2417 2011-01-18 10:36:42

titaniumbones
Scratcher
Registered: 2010-04-20
Posts: 8

Re: BYOB 3 - Discussion Thread

I wonder if the new OOP stuff might make it useful to have more complex messaging between sprites.  Here's a possible scenario.

Sprite "Gun" has a custom block "shoot", and a simple script that executes that command whenever the space bar is pressed.  Wouldn't be great if "shoot" spawned a new "bullet" sprite, by passing a signal to 'bullet' that included x,y, and direction information?  Is this already possible?  And do other people think it's worth implementing?

Thanks,
Matt

Offline

 

#2418 2011-01-18 10:44:49

titaniumbones
Scratcher
Registered: 2010-04-20
Posts: 8

Re: BYOB 3 - Discussion Thread

Another topic: 

I'm trying to figure out how to use BYOB in a computer club filled with 10-year-olds.  The BYOB tutorials are fantastic, but too hard for my kids, I think.  One thought I have is to use custom blocks to build rules of motion for sprites, then let the kids populate the world with whatever sprites they want, using the new functions (so far I have "fall" and "jump" -- I don't even play games so I'm not sure what else we need) to build scripts.  Then we could change the functions and see what happens to the world. 

Has anyone else done anything like this before?  I'd be interested to see your work, and maybe think about making a collection of such projects somewhere to use in class.  Thanks again!
Matt

Offline

 

#2419 2011-01-18 10:47:32

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

bbbeb wrote:

They all have different uses.

Sure.  But, for example, instead of having a block

SET STRETCH TO < >%

and another block

SET VSTRETCH TO < >%

you could just use the regular old SET block and say

SET <_STRETCH> TO < >

This could also potentially replace some of the regular Scratch blocks like

SET X TO < >
SET COSTUME TO < >
SET COLOR EFFECT TO < >

etc.

Oh! like [Set <ScrollY> to (50)]?
I get it, but then you would still need a bunch of reporters, so you could call them all from different areas still.
But, it simplifies the whole "Where is that block I need?" issue in Panther.


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

Offline

 

#2420 2011-01-18 15:22:06

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

Re: BYOB 3 - Discussion Thread

@ Jens
Would it be possible to make more advanced meshes that allowed multiple connections and cross WAN connections?


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

Offline

 

#2421 2011-01-18 22:41:46

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

Re: BYOB 3 - Discussion Thread

titaniumbones wrote:

Wouldn't be great if "shoot" spawned a new "bullet" sprite, by passing a signal to 'bullet' that included x,y, and direction information?  Is this already possible?

Yup!  (Well, as soon as we can spawn sprites from a script at all.)

In the bullet sprite, define a for-this-sprite-only custom block NEW BULLET with inputs XPOS, YPOS, and DIRECTION.  This is where you put the CLONE ME block.  Then, in the gun sprite, you say

LAUNCH [<NEW BULLET> OF <BULLET>] WITH INPUTS <xpos> <ypos> <dir>

That's the OF block in the sensing menu.  First choose the sprite, then the local variables and blocks will appear in the dropdown on the left.

Last edited by bharvey (2011-01-19 01:56:35)


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

Offline

 

#2422 2011-01-18 22:44:42

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

Re: BYOB 3 - Discussion Thread

titaniumbones wrote:

I'm trying to figure out how to use BYOB in a computer club filled with 10-year-olds...
Has anyone else done anything like this before?

In my own group of 10-year-olds, a bunch really liked the idea of learning a cool new version that nobody else had yet (this was a year ago), but quickly cooled off when I told them they couldn't upload BYOB projects to the Scratch web site.  sad

But I'd be super interested to see anything in the way of curriculum that you invent!


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

Offline

 

#2423 2011-01-18 22:52:29

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

Re: BYOB 3 - Discussion Thread

Another experimental version!

Jens wrote:

this version experiments with Lieberman-style inheritance in variables and named lists (in addition to custom-block inheritance):

  1) clones not only inherit the variable name slot, but also the prototype's variable value if they don't shadow it themselves. By default when spawning a sprite the clone copies all variable values and hence they are independent of the prototype's values. However, variable value inheritance is activated by deleting the clone's own named variable.

2) Same thing for named lists.

3) if a clone SETs or CHANGEs an inherited variable, the value-inheritance connection to the prototype's variable gets broken and both variable values become disassociated and independent of each other (the link can be restored by deleting the var)

4) if a clone modifies an inherited named list for which it doesn't have an own one, the prototype's list gets modified. Current existing blocks don't (yet) allow named list slots to be assigned another list.

5) If a watcher is shown onstage for an inherited variable or list, deleting it in the clone does not remove the watcher. Instead the prototype's values are inherited and displayed in the watcher. Each sprite can have it's own watcher for a value-inherited variable (and they'll all get synched automatically), but a value-inherited list watcher only gets shown for the prototype (it can be toggled in each clone), because in Scratch (and currently still in BYOB, too) the watcher is the list.

Enjoy!

Editor's note: This arrived in my inbox about four hours after the email from Jens saying "this will take me weeks!"  smile


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

Offline

 

#2424 2011-01-18 23:32:56

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

Re: BYOB 3 - Discussion Thread

bharvey wrote:

Editor's note: This arrived in my inbox about four hours after the email from Jens saying "this will take me weeks!"  smile

this is awesome


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

Offline

 

#2425 2011-01-19 05:19:54

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: BYOB 3 - Discussion Thread

14God wrote:

@ Jens
Would it be possible to make more advanced meshes that allowed multiple connections and cross WAN connections?

it would be exciting to develop the mesh networking feature further, but I'm afraid that I'm currently very much tied up with adding OOP features (prototype based inheritance for sprites) and more first-class-ness. However, you already can connect any number of BYOB sessions over the net, and they don't have to be in the same room.


Jens Mönig

Offline

 

Board footer