Classes, interfaces, singletons and enumerations

I'd like to have those added to help create custom data types.

Interfaces

Interfaces provide blocks that have to be implemented by selected classes, singletons, and sprites.
The interface block looks something like this:
) [Interface] Run with ▯◂▸)
Notice that the left side is concave - that is intentional, so blocks fit without height change

Classes

Classes do not exist on stage but are created using the clone block.
Class blocks look similar to the interface blocks

Singletons

Singletons contain variables, blocks, and each has a custom category, set by the "Block tab" menu
Blocks coming from singletons have singleton's name
ex. ([Players] create a new player) , and implemented interface blocks can be filled with singleton instance block: (singleton [ â–¾])

Enumerations

Enumerations have a limited set of values, defined in the "Possible values" tab which replaces the "Scripts" tab, but don't have blocks

Extended functionality

Classes, singletons, and sprites will have "Interfaces and extended functionality" block
This will extend to future types: 3D sprites, cloud sprites, etc.

For classes, try reading @bh's section on OOP in https://snap.berkeley.edu/doc/Brian-Harvey_Baby-language.pdf.

:slight_smile: I'll try to make it while the classes thing has already been made by bh on the manual and it used 4 pages (71-75)

NO!!!

while me and super sean did it even w/ that rejection.

thats vary easy to make
just make an options input and have the reporter to return itself

we have cloud lists already (i'm not going to show url because its hackable) and why do you need cloud sprites?

I mean dedicated classes that are easy to use, and don't require complex procedures e.g. (call (class object) with [get] [name] â—‚â–¸). Each class would have its tab and at least 3 blocks:

,while new ones can be defined by the user:

Are you looking to have a major redesign of the Snap! GUI? Where do you see these "tabs" appearing?

As I said,this has already made by me
https://snap.berkeley.edu/snap/snap.html#present:Username=18001767679&ProjectName=OBJECT%20LIBRARY%20WITH%20HELP!!!

Your project link doesn't work for me

Because !!! isn't in the link.If you manualy add it back it will work

The tabs would appear in the same location as "Scripts" tab.

Understood now :slight_smile:

It would be nice to see some mock visual layouts of your proposals.

I, personally, don't see such a request moving forward in the near future, but it could make for an interesting Snap! fork project.

And, can I suggest looking at GP as it has attempted to go down the class/instance route instead of the prototype Snap! one

How it might look:

Sprite
[Scripts][Costumes][Sounds][Implemented interfaces and classes]

Class
[Scripts][Implemented interfaces and classes]

Enumerations
[Values]

Singleton
[Scripts][Implemented interfaces and classes]

I was thinking for a more visual mock-up :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.