[Squeakland] Q: Leverage Overlapping Player to Etoys?

Alan Kay Alan.Kay at squeakland.org
Mon Jan 5 22:59:42 UTC 2004

Hi Ned --

At 11:13 AM -0800 1/5/04, Ned Konz wrote:
>On Monday 05 January 2004 8:25 am, Markus Gaelli wrote:
>>  Did we overlook some other way to find out with Etoys which of the UFOS
>>  have been hit by our shot?
>Well, there's the colorSees: test.
>>  If not, should be put it to miscellaneous?
>>  Is it a problem that we only
>>  return one of possible many overlapped players?
>How would you return more than one?
>I've been thinking about making a CollectionPlayer that can apply commands and
>slot setters to its members; if we had one of these it could be returned.
>However, there's a problem with slot getters, and with the display of such a
>collection (what should it look like if it's visible?).

It should look like (and be) a Holder.

>>  Should I send the changeset?
>Of course, though it may be of more interest to squeak-dev
>>  Another question: How do you destroy Players with Etoys? Is there
>>  something there and hidden?
>You'd have to get rid of all the costumes.
>In the case of players with identical behavior, you'd probably want them to be
>siblings, so there isn't the problem with class duplication. The "copy"
>pseudo-slot getter gives you one of these.
>>  We created the bombs of the UFOS by copying the "mother of all bombs".
>>  But we also wanted to
>>  destroy them, if they hit the ground.
>You could do
>	theBomb doMenuItem: 'delete'

This is a good way.

The way I do this is to do everything in a Playfield (which is a kind 
of Holder or vice versa).  Then I set up another playfield "PF" to 
use as temporary trash. So:
                  PF include theBomb
                  PF removeAll

When I'm doing stuff that results in lots of "atoms" in a Playfield, 
I reset by taking everything out of the playfield that I want to save 
(like the mother of the bomb)
                         PF include bombMother
and then do a Playfield removeAll.



>Ned Konz


More information about the Squeak-dev mailing list