Discuss Scratch

bharvey
Scratcher
1000+ posts

Snap! user discussion

tcrass wrote:

It wasn't all that bad before we introduced collision detection, so I guess this is a real bottleneck.
Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

Jens
Scratcher
100+ posts

Snap! user discussion

another idea is to avoid pixel-perfect collision detection altogether and only check for a threshold of DISTANCE TO, like NetLogo and many particle systems do. I'm not recommending this, because I love collision detection myself, but if that's the bottleneck on low-powered hardware it might be an idea…
tcrass
New to Scratch
7 posts

Snap! user discussion

Hi,

Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

we're doing sprite-sprite collision detection, not sprite-color. (spaceship vs asteroid, you know… ;-)

another idea is to avoid pixel-perfect collision detection altogether and only check for a threshold of DISTANCE TO, like NetLogo and many particle systems do. I'm not recommending this, because I love collision detection myself, but if that's the bottleneck on low-powered hardware it might be an idea…

Sigh… that's what I did in my first asteroid implementation some 25 years ago in TurboPascal… It seemed so promising to have “real” collision detection available in Snap!. (BTW, there sure is a bounding box overlap test prior to pixel-to-pixel comparison, right?)

Cheers –

– Torsten
tcrass
New to Scratch
7 posts

Snap! user discussion

OK, this is interesting…

Initially, we put the collision test into a generic “if <…>” start block. After moving it into the endless loop which moves the (asteroid) sprites, the animation looks a lot smoother! It seems the tests were performed way too often under the initial circumstances – perhaps for each sprite after each sprite's move (which for n sprites would sum up to n² tests, as compared to only n tests in the new implementation)?

Cheers –

– Torsten
Jens
Scratcher
100+ posts

Snap! user discussion

yes, Snap! performs a bounding box collision test before checking the pixels. Usually, sprite collision detection is really, really fast and efficient in Snap, because graphics cards kinda do it for almost free. Hmm, must be something about the Raspberry Pi that's slowing down graphics…
Jens
Scratcher
100+ posts

Snap! user discussion

Oh, I missed your second observation about optimizing performance by not using generic WHEN hat blocks! Great, I'm glad you found a way, yay!
xly
Scratcher
100+ posts

Snap! user discussion

bharvey wrote:

tcrass wrote:

It wasn't all that bad before we introduced collision detection, so I guess this is a real bottleneck.
Are you doing sprite-sprite collision detection, or sprite-color? Sprite-sprite is way faster. Often you can get the effect of sprite-color by nesting sprites, so the blue (or whatever) part of the sprite is actually a second sprite attached to the first.

After further testing the DISTANCE method suggested by Jens is excellent.

Last edited by xly (Nov. 5, 2017 21:08:06)

IAmTheGeekSquad1962
New to Scratch
4 posts

Snap! user discussion

I would like some information about running Snap in a classroom setting.

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
PullJosh
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
Any particular reason you don't want to use the hosted version that's already online?
bharvey
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
The normal thing is to run it from our web site. That does work on Chromebooks. If you want to install a local copy, it'll run, but you won't be able to log into our cloud server, so you'll have to save projects locally. I haven't used a Chromebook myself so I'm not sure, does it have local file storage?

IAmTheGeekSquad1962
New to Scratch
4 posts

Snap! user discussion

bharvey wrote:

IAmTheGeekSquad1962 wrote:

Is it possible to install snap on a server and let 12 or so students do development using Chromebooks?
The normal thing is to run it from our web site. That does work on Chromebooks. If you want to install a local copy, it'll run, but you won't be able to log into our cloud server, so you'll have to save projects locally. I haven't used a Chromebook myself so I'm not sure, does it have local file storage?

I've tried to create an account, but was never asked for a password during setup. Instead I got “data is temporarily unavailable Error ID…” I never received any confirmation email from snap.berkeley.edu. I did try to create the account a second time, but the system now recognizes that the id is already taken. It looks like the account only got partially created.
bharvey
Scratcher
1000+ posts

Snap! user discussion

IAmTheGeekSquad1962 wrote:

I've tried to create an account, but was never asked for a password during setup. Instead I got “data is temporarily unavailable Error ID…” I never received any confirmation email from snap.berkeley.edu. I did try to create the account a second time, but the system now recognizes that the id is already taken. It looks like the account only got partially created.
I'm sorry you had that problem. If you email me (bh@cs.berkeley.edu) the user ID I'll see about getting you a password.

Alternatively, click the “change password” item in the cloud menu and it should set a new password to your email on file.

sonnyglau
New to Scratch
1 post

Snap! user discussion

Hi,

I'm trying to help one of my students out. I'm trying to open her project and it is stuck in the “Opening project…” portion. The project will never open.

Here is the link to her project that won't open.

http://bjc.edc.org/snapsource/snap.html#present:Username=asmith8&ProjectName=snowman


Thanks!

Last edited by sonnyglau (Dec. 4, 2017 21:38:36)

bharvey
Scratcher
1000+ posts

Snap! user discussion

sonnyglau wrote:

I'm trying to help one of my students out. I'm trying to open her project and it is stuck in the “Opening project…” portion. The project will never open.
It's too big to load. Here's a version with the costumes and the huge dictionary removed. She can put in a smaller dictionary etc. and try again:
http://snap.berkeley.edu/snowman.xml

theLman
Scratcher
81 posts

Snap! user discussion

Hi everyone,

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem? I wonder if it's related to time zones?

Edit: By the way, the reference manual is amazing! It's so easy to follow. I wish all programming languages were documented in this style.

Last edited by theLman (Dec. 19, 2017 14:13:56)

bharvey
Scratcher
1000+ posts

Snap! user discussion

theLman wrote:

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem?
Sorry you're having this trouble!

This is a known problem. It happens rarely but persistently. We're working on it. Meanwhile, mail me (bh@cs.berkeley.edu) your Snap! login name and the email address you used, and we'll send you a password manually.

theLman
Scratcher
81 posts

Snap! user discussion

bharvey wrote:

theLman wrote:

I've been trying to get started on Snap a few times over the last year or so, but I can never seem to log on. When I try and re-set my password, it sends me a link, but when I (immediately) click on it I get the error message: “password reset key: <whatever it is> is no longer valid, please request a new one.” Has anyone else had this problem?
Sorry you're having this trouble!

This is a known problem. It happens rarely but persistently. We're working on it. Meanwhile, mail me (bh@cs.berkeley.edu) your Snap! login name and the email address you used, and we'll send you a password manually.

Thank you Looking forward to getting into SNAP!, the updates in 4.1 look great. Any updates on the rollout of the planned new front page?
bharvey
Scratcher
1000+ posts

Snap! user discussion

theLman wrote:

Any updates on the rollout of the planned new front page?
The latest theory is to have a beta release for brave people in Feb, and the big cutover in March.

theLman
Scratcher
81 posts

Snap! user discussion

bharvey wrote:

theLman wrote:

Any updates on the rollout of the planned new front page?
The latest theory is to have a beta release for brave people in Feb, and the big cutover in March.

That's exciting. Good luck with everything.
MichaelIsSoAnnoying
Scratcher
3 posts

Snap! user discussion

I'm working on a hangman project, and I would like to generate random words from a java script dictionary. Is there any way I could do this?

Powered by DjangoBB