eToys surprises

Ned Konz ned at squeakland.org
Wed Dec 22 06:28:12 UTC 2004


On Tuesday 21 December 2004 7:40 pm, Blake wrote:

> 1. The icons in the tutorials don't show up correctly (i.e., not lined up
> where they should be)

What tutorials and what icons?

> 2. It's easy for him to do something he shouldn't (in the sense of getting
> into a place he might have trouble getting out of). So far, though, it's
> been easy for him to get back, which is good.

Yes, it's not bulletproof. However, typically Etoys users have it in 
'EtoyFriendly' mode (there is a preference for this) which makes it harder to 
get stuck.

> I'm trying to construct a simple Lunar Lander game which, I hope, will be
> instructive about gravity as well as programming. However, I've hit some
> snags:
>
> 4. I've drawn a "lunar terrain" morph as an outline and was thinking about
> filling it in. However, when I click the repaint halo button, the canvas
> that comes up is wider than the terrain, which is squashed. This happens
> consistently. If I paint something that takes the full horizontal width of
> the canvas, and then repaint, it won't take the whole width any more.

Did you stretch the original sketch and then try to repaint it?

> 5. When you pull out an assignment tile by clicking on the <-, when it
> goes into a script viewer, the <- becomes an underscore. Have I got font
> problems or is this a bug?

This has been fixed in the Squeakland release, and probably also in 3.8. I'm 
guessing you're using 3.7. I suggest that if you're doing Etoys stuff you 
consider getting the Squeakland release. If you also want all the sources, 
etc. then get the Squeakland Developer's image.

There are also a number of other goodies in the Squeakland release, including 
Connectors 2 <g>.

Plus I've done keyboard support, which is nice for a Lunar Lander (you will 
need to "load updates" to get the fix for this).

> 6. It's cool that eToys tells you when you try to remove a variable that's
> in use; an "undo" would also be nice.

Yes.

> 7. Trying to use the "remove [item]" menu option on a variable brings up a
> debug window. Since the Squeakland stuff doesn't have this problem, this
> (and others) may be the result of my image (which is probably overloaded
> with squeak packages).

Or maybe it's just not got all the post-3.7 bug fixes.

> 8. Is there any eToy keyboard handler/script? Lunar Lander's a bit awkward
> with a mouse.

Yes, I've done keyboard handling for Etoys. Use the Squeakland or 3.8 images, 
and load the fix I posted recently (which should be in the Squeakland update 
stream by now, or you can get it from the list).

> 9. How hard is it to make new tiles for eToy use? What's the base class?

Do you want new *kinds of tiles* or just to *add new vocabulary items* to 
morphs? It's easy to do the latter.

To extend the vocabulary of a Morph, you can just add methods named like 
additionsToVocabularyCategory* to the class side (look for such methods to 
get an idea). For each item, you typically need a method in Player and the 
corresponding method(s) in your Morph class.

For example, here is Morph class >>
additionsToViewerCategoryLayout
 "Answer viewer additions for the 'layout' category"

 ^#(
  layout 
  (
   (slot clipSubmorphs 'Whether or not to clip my submorphs' Boolean readWrite 
Player getClipSubmorphs Player setClipSubmorphs:)

  ))


So this adds the 'clipSubmorphs' slot to the 'layout' vocabulary category. 
That slot (a pseudo-variable) is read/write, and is implemented by the 
methods #getClipSubmorphs and #setClipSubmorphs on Player. Those methods just 
call back to the morph that is the Player's costume:

Player>>getClipSubmorphs
 "Getter for costume's clipSubmorphs"
 ^ costume renderedMorph clipSubmorphs

The other kind of thing you can add (besides the pseudo-variable 'slot' type) 
is the 'command' type, as in:

additionsToViewerCategoryMiscellaneous
 "Answer viewer additions for the 'miscellaneous' category"
 ^#(
  miscellaneous 
  (
   (command doMenuItem: 'do the menu item' Menu)
   (command show 'make the object visible')

These don't have an associated return value, but they can have a single typed 
parameter.

I wouldn't recommend trying to make new *kinds of tiles*. It would probably be 
very uncomfortable to do so. I rather suspect that Scott Wallace himself 
would think twice before doing this.

However, if you need such things, I'd be interested in talking about why and 
how we could get the desired effect.

-- 
Ned Konz
http://bike-nomad.com/squeak/



More information about the Squeak-dev mailing list