<div dir="ltr"><span class="Apple-style-span" style="border-collapse: collapse; ">>Hi Kemal,<br><br>>it's part of the Etoys philosophy to have only a single class of player. For example, you can change the costume (the morph) of a player dynamically, so the player needs to have the vocabular to serve all the >different costumes it could wear. This would break if you create specialized subclasses of Player.<br>
<br>>Btw, in Smalltalk adding extension methods to other classes is not considered as "intrusive" as in other languages.<br><br>>Hth,<br><br>>- Bert -</span><br><div><span class="Apple-style-span" style="border-collapse: collapse;"><br>
</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">I don't understand. What is the best option for making morphs scriptable?</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">1. Extend Player </span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;">or</span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">2. Create a subclass of Player and add the method #newPlayerInstance to the morph which returns the correct instance of Player (DiceMorph and CalculatorMorph do this)</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse;">What problems could cause the second option?</span></div><div>
<span class="Apple-style-span" style="border-collapse: collapse;">Bye</span></div></div>