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

#1 2008-09-19 15:51:41

parseroo
Scratcher
Registered: 2008-09-05
Posts: 20

Waiting for Glide and other timed events -- Make optional?

This is just a thought about Scratch as part of implementing it in Flash.

As part of doing the execution engine and testing with Hanoi, it became obvious that glide and other timed events are all 'wait' events and lock up that 'Stack of Blocks' until they complete.  So if you glide to a new spot for a third of a second (10 frames), that stack of blocks is locked up for a third of a second.

I certainly think that makes sense as a default behavior but it might be useful to allow the waiting to be optional...  For example, if you use the Flash Player to do the Tower of Hanoi project, you can set the speed to do 100 steps per frame.  But the tower will not be solved faster at 100 than at 5 steps per frame because everything is waiting for the glides to complete (you never see two disks gliding at the same time).  50 moves at 0.10s per move = 5 seconds.  It would be nice to have the glides be asynchronous -- I never read the x,y position of the disks so I don't care to wait for them to be stable.  At least as long as I don't try to move the same sprite twice at overlapping times :-)

If there were two 'glide' blocks, one that waited and one that did not, people could both study the difference.  Also some scratch programs would execute faster because fewer of the stacks would be blocked. 

I realize there is a workaround: send a broadcast "glide-to" and pass three arguments.  The existence of the workaround is also interesting and does not require new blocks, so in that sense it is simpler.  But creating that broadcast and hat with parameters is a bit complicated currently.  So one (optional 'wait') or the other (easy 'broadcast with parameters') would be nice to have :-)

Offline

 

#2 2008-09-19 15:53:08

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Waiting for Glide and other timed events -- Make optional?

Well, you could always use two scripts...

Offline

 

Board footer