[Squeakland] Making a Copy of an eToy from a script and using the mouse pointer to activate an eToy script

Scott Wallace scott.wallace at squeakland.org
Fri Nov 10 06:04:46 PST 2006


Hi, again, Offray,

> My students and me are working in a kind of basic pingus/lemmings
> clone[1] using eToys. We would like to use the mouse pointer to  
> select a
> eToy and execute an script. The idea is to make click on a button, for
> example the one with the message "Detener al otro" ("Stop the other")
> and then select the eToy who would have this script enabled using  
> the mouse.

Perhaps you'll find the techniques illustrated in the attached  
project useful for your purposes.

In the project, all the star-lemmings (which are all siblings of one  
another) understand the messages "makeRed", "makeBlue",  
"startSpinning", and "stopSpinning", etc.

When you click on any of the buttons at the bottom, the cursor  
changes into a cross-hair, inviting you to choose a recipient for the  
button's message.  After you click on one of the star-lemmings, the  
designated message will be sent to the one you chose.

Thus, click on "One Red", and when the cursor changes to a cross- 
hair, click on a blue star-lemming, and it will be told to run its  
script named "makeRed", which in turn will make it red.  And so on  
for all four of the "One" buttons.

The four buttons with "Others" in their names tell all of the  
designated recipient's *siblings* to do the button's action, with the  
result tht every lemming *except* the one you click on gets the  
indicated message.  So the "One" buttons and the "Others" buttons are  
kind of opposites of each other.

Invoking the "cursor mode" for selecting the target is outside the  
scope of etoy tiles, so this required a single tiny textual script,  
named "chooseMessageTarget", which I wrote for the "world".  All the  
other code in the project is strictly tile scripts.

How close is this to what you're seeking?

Cheers,

  -- Scott

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Star Lemmings.004.pr
Type: application/octet-stream
Size: 133551 bytes
Desc: not available
Url : http://squeakland.org/pipermail/squeakland/attachments/20061110/283aa702/StarLemmings.004-0001.obj
-------------- next part --------------



More information about the Squeakland mailing list