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

#1 2008-10-20 18:14:57

bartybacon
Scratcher
Registered: 2008-04-29
Posts: 8

Distance block

What about a distance block? Kinda like "Distance between (drop-down menu with objects) and (another drop-down menu)...

Offline

 

#2 2008-10-20 18:38:39

deerel
Scratcher
Registered: 2008-08-23
Posts: 89

Re: Distance block

<set{ old x }to( <x position>
<set{ old y }to( <y position>
<go to[ first object

then you can use
<distance to[ second object

then don't forget
<go to x sad  <{ old x }> )y sad  <{ old y }>

but yes, one block would be more useful, but this attitude then creates lots of "shortcut" blocks and the cons overweigh the pros...

One suggestion may be "save state" and "restore state" would help these situations (like also direction to something)...
Second possible suggestion is to parametrize "distance from: to:" and "direction from: to:" so it can contain either an object (including me) or [x,y] point, then I always use the same block for distance between A and B (howerver A and B are specified) or the direction leading from A to B... question is whether this generalized solution is too hard for children or not...

p.s. the same for goto and glide...

Last edited by deerel (2008-10-20 18:41:51)

Offline

 

Board footer