Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Snap! user discussion
- frodewin
- Scratcher
500+ posts
Snap! user discussion
There is currently a discussion on the potential of block-based programming on response to a German Youtube video showing how to make a game with Snap! https://www.youtube.com/watch?v=kSLnwUuE3Xg
I would like to give a list of examples of excellent Snap! games. However, AFAIK there is no webpage for finding projects yet.
Can anybody provide me some links to sophisticated games made with Snap! ? They should be at the level of what Griffpatch and others are making for Scratch.
I would like to give a list of examples of excellent Snap! games. However, AFAIK there is no webpage for finding projects yet.
Can anybody provide me some links to sophisticated games made with Snap! ? They should be at the level of what Griffpatch and others are making for Scratch.
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
Well, for starters, there are a few on Can anybody provide me some links to sophisticated games made with Snap! ?http://snap.berkeley.edu
But also, look in YouTube for “CS 10 final project” to see what Berkeley students have done in Snap!.
- frodewin
- Scratcher
500+ posts
Snap! user discussion
http://snap.berkeley.eduWell, for starters, there are a few on
Thanks for the quick reply, I already checked the projects on the startpage out, but what I found there was rather simple starter projects (Snake, Space Invaders, ) which can be good inspiration, but I meant more games at a level with like this one or that one.
!.But also, look in YouTube for “CS 10 final project” to see what Berkeley students have done in Snap
These are some very interesting projects, thanks! Is there a list with Snap URLs or another way to get to the game? In particular I would be interested in the CS10 Final Project: the Murderer and the CS10 Final Project: A Beautiful and Joyous Quest. If not I can link to the Youtube videos which is also fine :-)
Edit: Replaced some grammar mistakes with new ones…
Last edited by frodewin (April 12, 2017 18:32:11)
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
I passed this request on to Dan Garcia, who teaches CS 10. Is there a list with Snap URLs or another way to get to the game?
This led to an interesting discussion in which he said “of course we'd have to track down the students and ask for permission to distribute their projects” and I said “Did they share them?” and he said yes and so I said “then they've already agreed” and he said “wait, what, they just shared them with the course staff.”
At first I thought he was just tripping but eventually understood his point, which was that since we don't have the social-media site up yet, in practice “sharing” means you get a URL that you have to email to the particular people you want to share with. But still I said “nevertheless that's what they agreed to when they checked the little ‘I have read the Terms of Service’ box” and he, with some justification, said “oh, come on, nobody reads those things.”
And then he said “that's not what anyone expects” and so I felt on firmer ground, pointing out that 99.9999% of our users are also Scratch users, and so they understand perfectly well what sharing means. And he said “well that's not what teachers expect” (because, it turns out, he was thinking about solutions to homework exercises) and I said “no, Dan, the teachers are Scratchers, too; it's just you who have this wrong expectation.”
So, I'm wondering if anyone has some evidence about this. (Alas, saying what you think doesn't count, since you are provably Scratchers. It'd have to be something like “My teacher said…” or the like.)
Oh, and then I said “anyway, why do you care about keeping homework solutions secret?” and he said “well, we have to grade them,” and I said “why? Homework is to learn from, not to prove what you already know.” And it's funny because he must have heard me say that in exactly the same words dozens of times, but he went quiet and then said “Oh. Huh.” just as if it were a new idea to him. Which speaks to me about how firmly entrenched some ideas are in the minds of teachers.
- doloop
- New to Scratch
15 posts
Snap! user discussion
TParr - VirtualMachineInterpreter here: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeterI've shared my project
And, I've created a short YouTube video showing it in operation here: https://youtu.be/74GH0Qr9VA0
This is an effort to fix the links in my original message re making a virtual machine in Snap!
Video of Prof Parr: https://www.youtube.com/watch?v=74GH0Qr9VA0&feature=youtu.be
Snap! shared project: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeter
My YouTube video of the project running (computing 5!): https://youtu.be/74GH0Qr9VA0
- doloop
- New to Scratch
15 posts
Snap! user discussion
TParr - VirtualMachineInterpreter here: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeterI've shared my project
And, I've created a short YouTube video showing it in operation here: https://youtu.be/74GH0Qr9VA0
This is an effort to fix the links in my original message re making a virtual machine in Snap!
Video of Prof Parr: https://www.youtube.com/watch?v=74GH0Qr9VA0&feature=youtu.be
Snap! shared project: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeter
My YouTube video of the project running (computing 5!): https://youtu.be/74GH0Qr9VA0
Last edited by doloop (April 14, 2017 19:38:05)
- Jonathan50
- Scratcher
1000+ posts
Snap! user discussion
The links won't work until you become a Scratcher (right now you are a New Scratcher).
Not yet a Knight of the Mu Calculus.
- Gabriel2900
- Scratcher
100+ posts
Snap! user discussion
TParr - VirtualMachineInterpreter here: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeterI've shared my project
And, I've created a short YouTube video showing it in operation here: https://youtu.be/74GH0Qr9VA0
This is an effort to fix the links in my original message re making a virtual machine in Snap!
Video of Prof Parr: https://www.youtube.com/watch?v=74GH0Qr9VA0&feature=youtu.be
Snap! shared project: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeter
My YouTube video of the project running (computing 5!): https://youtu.be/74GH0Qr9VA0
See. It works for me.TParr - VirtualMachineInterpreter here: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeterI've shared my project
And, I've created a short YouTube video showing it in operation here: https://youtu.be/74GH0Qr9VA0
This is an effort to fix the links in my original message re making a virtual machine in Snap!
Video of Prof Parr: https://www.youtube.com/watch?v=74GH0Qr9VA0&feature=youtu.be
Snap! shared project: http://snap.berkeley.edu/snapsource/snap.html#present:Username=doloop&ProjectName=TParr%20-%20VirtualMachineInterpeter
My YouTube video of the project running (computing 5!): https://youtu.be/74GH0Qr9VA0
- gbuk
- Scratcher
5 posts
Snap! user discussion
I am relatively new to Snap! and especially its internals.
(I did some work, about 7 years ago, for the Open University using Scratch 1.4. However, I haven't looked at Snap! internals until now.)
I have some questions:
Q1) How should I add more symbols to the Block Editor's “Edit Label Fragment”?
“Edit Label Fragment” has a drop-down list of small symbols; for example from square and pointRight to robot and magnifyingGlass.
I have found code in blocks.js which draws those symbols onto a canvas. I want to avoid changing blocks.js if possible.
Is there a mechanism which enables new symbols to be added without changing blocks.js? For example, is there an ‘API’ to add new symbols to “Edit Label Fragment” drop-down list? Or is there a better way?
Ideally my code which modifies that list would be encapsulated in an imported project that the user could choose. Is that practical?
Q2) Is there a way to make the “Edit Label Fragment” drop-down symbol list scroll?
When the browser window is reduced (to allow me to see other windows) the list is too tall to fit the window. Some symbols are beyond the window and, AFAICT, they can't be selected. This may be a bug, or my lack of familiarity with Snap!
(I did some work, about 7 years ago, for the Open University using Scratch 1.4. However, I haven't looked at Snap! internals until now.)
I have some questions:
Q1) How should I add more symbols to the Block Editor's “Edit Label Fragment”?
“Edit Label Fragment” has a drop-down list of small symbols; for example from square and pointRight to robot and magnifyingGlass.
I have found code in blocks.js which draws those symbols onto a canvas. I want to avoid changing blocks.js if possible.
Is there a mechanism which enables new symbols to be added without changing blocks.js? For example, is there an ‘API’ to add new symbols to “Edit Label Fragment” drop-down list? Or is there a better way?
Ideally my code which modifies that list would be encapsulated in an imported project that the user could choose. Is that practical?
Q2) Is there a way to make the “Edit Label Fragment” drop-down symbol list scroll?
When the browser window is reduced (to allow me to see other windows) the list is too tall to fit the window. Some symbols are beyond the window and, AFAICT, they can't be selected. This may be a bug, or my lack of familiarity with Snap!
Last edited by gbuk (April 15, 2017 15:08:27)
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
I'm afraid the only way is the way you already know about. But if you're going to do that, make it so the user can type something like $#03bb to get a lambda (or whatever Unicode character), instead of just adding specific drawn glyphs to the menu. Q1) How should I add more symbols to the Block Editor's “Edit Label Fragment”?
Ideally my code which modifies that list would be encapsulated in an imported project that the user could choose. Is that practical?You can use the Javascript Function block (in Operators) to create new primitives that you code in js.
Q2) Is there a way to make the “Edit Label Fragment” drop-down symbol list scroll?Not if you mean an easy way. MenuMorphs aren't scrollable. You could invent a ScrollableMenuMorph that inherits from MenuMorph and includes code you steal from ScrollableFrameMorph. That might be worth doing, although I'd be inclined instead to use an existing feature, namely submenus, so you could have a submenu “arrows” with all the arrow shapes, etc.
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
I passed this on to Dan Garcia. There isn't an easy-to-use list of them, but they're probably all accessible somehow or other. I could try bugging him again (but see the note above about permissions). Is there a list with Snap URLs or another way to get to the game?
- gbuk
- Scratcher
5 posts
Snap! user discussion
The symbols (likely) won't be any standard unicode character glyph.I'm afraid the only way is the way you already know about. But if you're going to do that, make it so the user can type something like $#03bb to get a lambda (or whatever Unicode character), instead of just adding specific drawn glyphs to the menu. Q1) How should I add more symbols to the Block Editor's “Edit Label Fragment”?
Are you saying we should use Unicode ‘Private-Use Characters’ (http://www.unicode.org/faq/private_use.html) for our symbols?
If that is what you mean, does Snap! recommend a range of Unicode ‘Private-Use Characters’ code-points?
Okay. So we can avoid messing with the Snap! code base. Lovely!You can use the Javascript Function block (in Operators) to create new primitives that you code in js. Ideally … code … would be encapsulated in an imported project …
Okay, I think a submenu might be clearer anyway. Though if they were Unicode code points, I could imagine there's less need to modify this menu anyway.Not if you mean an easy way. MenuMorphs aren't scrollable. You could invent a ScrollableMenuMorph that inherits from MenuMorph and includes code you steal from ScrollableFrameMorph. That might be worth doing, although I'd be inclined instead to use an existing feature, namely submenus, so you could have a submenu “arrows” with all the arrow shapes, etc. Q2) Is there a way to make the “Edit Label Fragment” drop-down symbol list scroll?
Is there a recommendation on how to add custom glyphs (referenced as Unicode code points, maybe ‘Private-use’) to Snap! ?
Thank you very much for your thorough and clear answers. They are very helpful.
Last edited by gbuk (April 16, 2017 10:48:03)
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
http://www.unicode.org/faq/private_use.html) for our symbols?Oh, no, I just meant that lots of times I want glyphs that Are you saying we should use Unicode ‘Private-Use Characters’ (are in Unicode (mostly it's lambda that I want) and I'm trying to hijack your issue. But you can paste the actual character into the title text field, so I don't really need it.
Okay, I think a submenu might be clearer anyway. Though if they were Unicode code points, I could imagine there's less need to modify this menu anyway.Hot news: Jens has implemented scrollable menus in GP and plans to add them to Snap! too.
- frodewin
- Scratcher
500+ posts
Snap! user discussion
I passed this on to Dan Garcia. There isn't an easy-to-use list of them, but they're probably all accessible somehow or other. I could try bugging him again (but see the note above about permissions). Is there a list with Snap URLs or another way to get to the game?
I saw your explanation above, thanks. It actually triggered a discussion in our (German-speaking) online Scratch Club today. Not that we came up with a solution to the problem. I understand - but don't agree with - the teachers' concerns and on the other hand such a limitation on finding and accessing best practice projects really hinders the progress in the community.
- ironmannn
- Scratcher
100+ posts
Snap! user discussion
So I found an interesting bug in Snap!.
I figured out how to access this within a function when using the javascript reporter and run block. that runs fine an all with one function, here's an example of such code that runs without a problem.
however, when I add another function to the code, even if I don't call the first function I created within that new one. Snap soon freezes after executing the code and I have to reload the page in order to get any further work done.
I'm not entirely sure what's going on, but I thought it would be worth reporting here.
EDIT: Okay, it seems to be something else. I tried to remove the function and just write it's code within the main function, the code executes sucessfully but it's still crashing the moment the code has executed.
I figured out how to access this within a function when using the javascript reporter and run block. that runs fine an all with one function, here's an example of such code that runs without a problem.
this.line = function (x1, y1, x2, y2)
{
this.up();
this.gotoXY(x1, y1);
this.down();
this.gotoXY(x2, y2);
this.up();
};
this.line(0, 0, 100, 100);
however, when I add another function to the code, even if I don't call the first function I created within that new one. Snap soon freezes after executing the code and I have to reload the page in order to get any further work done.
this.line = function (x1, y1, x2, y2)
{
this.up();
this.gotoXY(x1, y1);
this.down();
this.gotoXY(x2, y2);
this.up();
};
this.genTile = function (size, degrees)
{
this.clear();
//Define coordinate table arrays.
coX = [];
coY = [];
// Convert degrees to radians.
radians = degrees * (3.1415 / 180);
// calculate boundaries of starting quadrilateral.
aX = -1 * size / 2;
aY = size / 2;
bX = size / 2;
bY = -1 * size / 2;
// Generate our coordinates.
clockY = 0;
while (clockY < size)
{
coY.push(aY - clockY);
coY.push(aY - clockY);
coX.push(aX);
coX.push(bX);
clockY = clockY + 1;
};
// Test code to ensure the coordinates are being generated correctly.
/*clockC = 0;
while (clockC < coX.length - 1)
{
this.line(aX, coY[clockC], bX, coY[clockC]);
clockC = clockC + 2;
};*/
};
this.genTile(45, 0);
I'm not entirely sure what's going on, but I thought it would be worth reporting here.
EDIT: Okay, it seems to be something else. I tried to remove the function and just write it's code within the main function, the code executes sucessfully but it's still crashing the moment the code has executed.
this.genTile = function (size, degrees)
{
this.clear();
//Define coordinate table arrays.
coX = [];
coY = [];
// Convert degrees to radians.
radians = degrees * (3.1415 / 180);
// calculate boundaries of starting quadrilateral.
aX = -1 * size / 2;
aY = size / 2;
bX = size / 2;
bY = -1 * size / 2;
clockY = 0;
while (clockY < size)
{
coY.push(aY - clockY);
coY.push(aY - clockY);
coX.push(aX);
coX.push(bX);
clockY = clockY + 1;
};
clockC = 0;
while (clockC < coX.length)
{
this.up();
this.gotoXY(coX[clockC], coY[clockC]);
this.down();
this.gotoXY(coX[clockC + 1], coY[clockC + 1]);
clockC = clockC + 1;
};
};
this.genTile(45, 0);
Last edited by ironmannn (April 27, 2017 15:21:31)
when green flag clicked
do really complicated thing
- bharvey
- Scratcher
1000+ posts
Snap! user discussion
When I edit your code to put a So I found an interesting bug in Snap!. var at the beginning of genTile so that you're not making a zillion global variables, it works. I presume that one of the names you used is a global variable in Snap! but I didn't bother working out which one. Sorry, not a Snap! bug.
- joefarebrother
- Scratcher
500+ posts
Snap! user discussion
IIRC from the last time I looked at the Snap! code, it's radians, which is a global function in Snap!. Assigning it to something that isn't a function breaks a lot of stuff.
(Opening the web console would have probably revealed this as you'd probably see errors like “radians is not a function” being reported from snap!'s code)
(Opening the web console would have probably revealed this as you'd probably see errors like “radians is not a function” being reported from snap!'s code)
#3138May 1, 2017 13:44:41
- ironmannn
- Scratcher
100+ posts
Snap! user discussion
When I edit your code to put a So I found an interesting bug in Snap!. var at the beginning of genTile so that you're not making a zillion global variables, it works. I presume that one of the names you used is a global variable in Snap! but I didn't bother working out which one. Sorry, not a Snap! bug.
Interesting, I'll have to take a look into that. Thanks for the help.
when green flag clicked
do really complicated thing
#3139May 7, 2017 23:03:11
- JustAMarioFan
- Scratcher
4 posts
Snap! user discussion
Hey, I have a little issue, I want to try and convert my file to exe it works however what's irratating me is on the top it says B.Y.O.B I want it to be the title of the game is there a way? Thanks
#3140May 8, 2017 03:52:35
- Jonathan50
- Scratcher
1000+ posts
Snap! user discussion
Here's one way, open the file “BYOB Development”, shift-click Edit and turn fill screen off, then click on the white space and open a browser. Hey, I have a little issue, I want to try and convert my file to exe it works however what's irratating me is on the top it says B.Y.O.B I want it to be the title of the game is there a way? Thanks
Go to Scratch-UI-Panes, ScratchFrameMorph, private, updateProjectName, and modify the method and go Alt+S or Command+S.
I completely commented out everything from projectTitleMorph to the next period by putting it in double-quotes and put the line “s _ ‘test’.” below it (put the name of the game instead of test).
Then you can close the browser, shift-click edit again and save image for end user.
Open BYOB again with your project and compile the project again, now when you open the compiled project it will say the name of the game in the title
(although it does flash “BYOB.image” for a second, I don't know what to do about that)
If you like you can change it back now, this won't affect your new compiled project but you'll have to change it back again when you want to compile it again. I guess it's possible to change makeExe to do this for you each time using the project name though.
Maybe there's a better way but I hope this helps
Last edited by Jonathan50 (May 8, 2017 03:53:49)
Not yet a Knight of the Mu Calculus.