Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

Jonathan50 wrote:

Does “Release” in the right-click menu of a clone mean to turn it into a Scratch 2.0-like clone?
Well, not exactly. It's still attached to its parent and can share data and attributes with its parent. But we have two kinds of clone, neither exactly like Scratch because their “clones” are just copies. The two kinds are permanent and temporary. Temporary ones aren't in the sprite corral (although I'm hoping that will sort of change, so you'll be able to find them by clicking something, not yet designed) and die when you hit the stop button. Permanent ones are in the sprite corral and don't disappear on stop. (I'm not sure having them in the sprite corral is the right choice. I think they should be hidden but findable, just like temporaries.) “Release” turns a permanent clone into a temporary one. Temporary ones are more like Scratch ones, but they still share with their parents.

dev_in_spain
New to Scratch
4 posts

Snap! user discussion

Hi,

I am new to Snap! and I am investigating to use it for teaching very focussed programming lessons. To do this we planned to have a version of Snap without any blocks, and then by using custom block libraries, show the blocks we need, so that a learner would say only have access to 5 blocks, which would be enough to solve the lesson they are working.

I was looking at the source code today and figured out how to hide blocks by commenting them out (in the objects.js) and I was wondering if there was a way to export (all or a subset) of the basic blocks into libraries, such that, we can hide ALL blocks and then create libraries of subsets of the basic blocks, to be imported when the project is loaded up?

After a Learner has done one of these lessons, would love to be able to share their creation, without loading the whole editor, is that possible? Is there a viewer that we can just push the XML to, and it runs? Any pointers to examples of this would be appreciated.

Which Version would you suggest is the most production friendly? 4.0? or is the 4.1 Beta sufficiently stable?

Regards

Mark
bharvey
Scratcher
1000+ posts

Snap! user discussion

dev_in_spain wrote:

To do this we planned to have a version of Snap without any blocks, and then by using custom block libraries, show the blocks we need, so that a learner would say only have access to 5 blocks, which would be enough to solve the lesson they are working.
Hi, welcome!

We have ways to do more or less what you want, without any need to modify the Snap! source code. But you may not be satisfied with our solution because it's possible (by design!) for students to “escape” into the full Snap! environment.

To hide primitives, right-click (control-click, however your computer does secondary click) on the grey background of the palette (the area at the left where the available blocks are listed) and choose “hide primitives.” (You have to do this in each of the eight palettes.) Alternatively, you can hide primitives one by one, by right-clicking on a particular block in the palette and choosing “hide.” When you save a project, the hidden status is saved with it, so when students load the project they will see the reduced palette you've set up.

But of course a student can right-click on the palette and choose “show primitives.” Our idea is that students understand that games have rules, and that a reduced-palette project is a game, in which they are to solve a puzzle under constraints. And we really hate the idea of limiting students' being in control of their tools.

As for sharing projects, by default when someone opens a shared project it starts in presentation mode, in which only the stage (at double size) is visible. We haven't implemented a separate viewer because it wouldn't really be able to eliminate much of the Snap! code; in order to interpret scripts and run animations, you need the scheduler, the interpreter, the Morphic widget manager, etc. You can add “&hideControls” to the URL of the shared project to hide the buttons above the stage, making it harder to get out of presentation mode, but of course this isn't a real security feature because someone who wants to read the code can just load the project and delete that part of the URL.

One thing you should know is that if you run your own copy of Snap! it will be unable to save projects to our cloud storage back end, which accepts connections only from snap.berkeley.edu and our official mirror sites. This restriction isn't because we want to discourage people modifying the code; there are several fantastic Snap! mods that we love, but they run their own back ends. We just don't want people to use our online storage for things other than Snap! projects.

I hope this helps.

Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

How do I access the cloud storage for my account to delete or rename projects?

Is there a way for a teacher to access the cloud storage of their students?

Apparently naming a project is one-shot and if someone saves a project named “fred-is-a-doody-head” there does not seem to be a way to delete it via the Snap File menu.
Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

Okay, whoops, I didn't see delete in the Open box. Though that is a weird UI design. “To delete something, go to the Open menu”..
bharvey
Scratcher
1000+ posts

Snap! user discussion

Dale_Mahalko wrote:

Though that is a weird UI design. “To delete something, go to the Open menu”..
Agreed. This will improve when the new back end and new web site are finished.

Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

Trying to figure out how to store polyphonic music notes in lists as a “player piano” type scroll. This probably is not a good idea as there is no way (that I can find) to insert data fields between already existing fields, so I can't insert or delete if the notation is not correct.

Also the script editor is probably going to gag on a scroll containing a few hundred note lists in a single huge object like this

note-octave/(sharp/flat)/length in beats/instrument

http://i.imgur.com/mFafKe1.png

I don't know of a way to edit a list of lists of lists of music notes outside the browser, and then paste it in.


Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

Also I suppose I should explain the padding. I want all cells for the music notes to be arranged vertically so I can easily see the beat timing. If I don't pad the cells that aren't actively playing notes, then all the small cells end up on the same line and it is very hard to visualize what I am doing…

http://i.imgur.com/0DFKx5y.png
bharvey
Scratcher
1000+ posts

Snap! user discussion

If you make a CSV file, e.g., in a spreadsheet, you can convert it to a list of lists this way:

1. Make a global variable and leave its watcher on the stage.
2. Right-click the watcher and select “import.”
3. Load your file.

You now just have a large text string. To convert it to a list of lists, do this:

The hard-to-read character in the second input slot of the first SPLIT block is a comma.

Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

hmm, I guess in-Snap music isn't going to work as I was expecting. There are only four “waveform instruments”, I don't have access to MIDI instruments, and I can't set an imported sound sample as an instrument and play it at different speeds to simulate notes.

Also trying to use the waveform instruments at high speeds, just results in a very loud popping/clicking noises.

http://snap.berkeley.edu/snapsource/dev/snap.html#present:Username=lhs-dmahalko&ProjectName=Instrument%20popping%20noise

dev_in_spain
New to Scratch
4 posts

Snap! user discussion

bharvey wrote:

Hi, welcome!

We have ways to do more or less what you want, without any need to modify the Snap! source code. But you may not be satisfied with our solution because it's possible (by design!) for students to “escape” into the full Snap! environment.

To hide primitives, right-click (control-click, however your computer does secondary click) on the grey background of the palette (the area at the left where the available blocks are listed) and choose “hide primitives.” (You have to do this in each of the eight palettes.) Alternatively, you can hide primitives one by one, by right-clicking on a particular block in the palette and choosing “hide.” When you save a project, the hidden status is saved with it, so when students load the project they will see the reduced palette you've set up.

But of course a student can right-click on the palette and choose “show primitives.” Our idea is that students understand that games have rules, and that a reduced-palette project is a game, in which they are to solve a puzzle under constraints. And we really hate the idea of limiting students' being in control of their tools.


Thanks, for the welcome and the great information. I see in the Hour of Code (http://snap.berkeley.edu/hoc/#1) that you have a similar approach, was that a custom built project, or is something like that potentially configurable? Is that source code available? My aim is to provide a minimalistic UI similar to the HoC that I have mentioned earlier.


As for sharing projects, by default when someone opens a shared project it starts in presentation mode, in which only the stage (at double size) is visible. We haven't implemented a separate viewer because it wouldn't really be able to eliminate much of the Snap! code; in order to interpret scripts and run animations, you need the scheduler, the interpreter, the Morphic widget manager, etc. You can add “&hideControls” to the URL of the shared project to hide the buttons above the stage, making it harder to get out of presentation mode, but of course this isn't a real security feature because someone who wants to read the code can just load the project and delete that part of the URL.

One thing you should know is that if you run your own copy of Snap! it will be unable to save projects to our cloud storage back end, which accepts connections only from snap.berkeley.edu and our official mirror sites. This restriction isn't because we want to discourage people modifying the code; there are several fantastic Snap! mods that we love, but they run their own back ends. We just don't want people to use our online storage for things other than Snap! projects.

I hope this helps.

Thanks, we have our own backend to store the results, and to use them to present the results again. So we will do some hefty customizations if need be to handle pairing down the UI and saving to our backend etc.

Thanks again
bharvey
Scratcher
1000+ posts

Snap! user discussion

Dale_Mahalko wrote:

Also trying to use the waveform instruments at high speeds, just results in a very loud popping/clicking noises.
There's a pending pull request fixing this, I think. We know that music isn't in great shape; Javascript doesn't give us very good access to MIDI. Someday…

Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

I made a simple hexadecimal to binary converter. As usual I am sure this is far from ideal, but it works.

http://snap.berkeley.edu/snapsource/dev/snap.html#present:Username=lhs-dmahalko&ProjectName=Hexadecimal%20string%20to%20binary%20v0.1

I can see the result value on the stage, but I can't figure out how to actually copy the result to the clipboard so that I can paste it into Notepad. There is an Export option when I right-click on the output string on the stage, but this just opens a new blank tab in Chrome. If I click on it in the variable list, it shows the data as a tool tip but again I can't copy it to the clipboard.

Is there a way to insert the output into an editable list box that I can then Copy to the clipboard in the UI?

,

(Yes, I'm using this as a real world utility language for work…)

RegQueryValue: HKCU\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount\$$windows.data.unifiedtile.startglobalproperties\Current\Data
Type: REG_BINARY
Length: 181
Data: 02 00 00 00 BD A2 58 5C 06 12 D3 01 00 00 00 00

I need that data string in binary…
bharvey
Scratcher
1000+ posts

Snap! user discussion

Dale_Mahalko wrote:

There is an Export option when I right-click on the output string on the stage, but this just opens a new blank tab in Chrome.
Congratulations! You are the first to report a bug newly introduced in the dev version. Export works properly for this project in non-dev Snap!, and also in dev in Firefox, but not Chrome.

Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

I have never liked the Scratch code commenting system. Comments stick out way off to the right, but typically the script editing area is very width-limited, and it is very annoying to have to scroll around to read comments.

What I would prefer is inline comments which can be inserted directly into the code as a code block. I have found a sort-of workaround for this. I define a variable named “Rem” and stick all my comments in there. But there are two downsides.

1. This is a variable that does nothing but is constantly changing its values with each comment line, so there is likely a tiny impact on performance

2. Multiline commenting in an expanding list box is apparently not possible, so writing multi-line inline comments this way is difficult and annoying, and must be split across multiple separate “Set Rem To” statements. I do not see any particular reason why a multiline text box should not be permitted.
Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

I am still trying to figure out the mechanics of my “Mario knockoff” to make it run at a high framerate.

Apparently objects can be “drawn” outside the viewport, they just are not visible. So apparently I could spawn all sprite blocks to generate the entire world right away when the level loads. It is unclear to me if having hundreds of sprites existing outside the viewport makes rendering slower.

I suppose I could tell sprites to hide themselves if they are outside the viewport, and to unhide just as they are about to come into view in the viewport, so that they don't need to be clipped as they are already hidden anyway. It is unclear to me if a hidden object uses less processing if it is outside the viewport.

If sprites slow the rendering whether hidden or visible and outside the viewport, then the third route is to constantly load sprites just in front of the player off-screen, as the player moves forward, and also removing sprites that have gone off-screen behind the player. This keeps the total world sprite count as low as possible.
Dale_Mahalko
New to Scratch
66 posts

Snap! user discussion

Oh… no…..

I just got an “Oh snap!” in Chrome after a few hours of editing the Mario thingy. I didn't save my work in a while. Arrrrgghhh..

Lost about 2-3 hours of intense work. I see no way to recover it. It just reloaded an old save from hours ago when I reloaded the page.

Last edited by Dale_Mahalko (Aug. 15, 2017 10:05:20)

bharvey
Scratcher
1000+ posts

Snap! user discussion

Dale_Mahalko wrote:

What I would prefer is inline comments which can be inserted directly into the code as a code block.
I just make a block that doesn't do anything:


For multiline inputs, you can load the “allow multi-line text input” library and then

bharvey
Scratcher
1000+ posts

Snap! user discussion

Dale_Mahalko wrote:

It is unclear to me if having hundreds of sprites existing outside the viewport makes rendering slower.
I don't think so. That is, I guess it takes a little time to check that they are outside, but they aren't rendered, I'm pretty sure.

It is unclear to me if a hidden object uses less processing if it is outside the viewport.
Hidden objects do not take time to render.

Just try writing your program as simply as possible, and if it's too slow, then we can worry about how to fix it. Also, try the dev version, which is faster for some things.

P.S. Sorry about your crash! Autosave is high on my list.

vgbonilla
New to Scratch
1 post

Snap! user discussion

@Jonathan50, I've downloaded your websocket project and installed it on my custom server. I serve Snap! with your websocket enhancement. I connect via "open websocket to ws/“ and I see the traffic on my server, my server upgrades the connection to websocket and then when O try to use ”send to websocket >", I get nothing. Would you be able to help me understand your code?

Thanks in advance,
Victor

Powered by DjangoBB

Standard | Mobile