[Etoys] Custom accessors for custom morphs

Bert Freudenberg bert at freudenbergs.de
Sat Sep 22 09:38:31 EDT 2007


On Sep 22, 2007, at 5:09 , Matthew Fulmer wrote:

> I was trying a custom morph/etoy and I wanted to make some of
> its instance variables (minAngle, maxAngle) accessible from the
> Viewer. I couldn't find any way to do this other than by adding
> four accessor methods to class Player. It seems this should only
> involve class modifications, but I don't see a way to make that
> happen. I did this in 3.10.
>
> Is there a better way to do this that I am missing, or is Player
> really that ugly?

One of the core ideas of Etoys was to have only a single "rich"  
object type, not a hierarchy of classes. The embodiment of that idea  
is class Player.

By current standards, that design is indeed "ugly". But we're stuck  
with it at least for this generation of Etoys. The Tweak version of  
Etoys solved that problem.

It helps if you think of the *player* as primary scripted object. You  
are not scripting a Morph, it is only the costume for a Player, and  
can therefore be exchanged.

- Bert -




More information about the Etoys mailing list