touchesA: (Does anyone think it works?)

Bob Arning arning at charm.net
Wed Feb 20 20:58:34 UTC 2002


On Wed, 20 Feb 2002 12:09:03 -0800 Jerry Balzano <gjbalzano at ucsd.edu> wrote:
>I then dragged the Blob on top of the StarSketch and fired the script.  It
>did not work!
>
>After a number of unsuccessful and therefore inconsequential variations, I
>happened to create a duplicate of the StarSketch (using the green
>"duplicate" handle on its halo).  I added another Test to my script: the
>Test was the (built-in) test for whether the StarSketch touchesA
>StarSketch.  If Yes, then StarSketch should make the "clink" sound.
>
>I then dragged StarSketch over its duplicate, StarSketch1, and fired the
>script.  Clink!
>
>Dragged the Blob over StarSketch1, fired the script.  Croak!
>
>But Blob over original StarSketch ... nothing.
>
>This can't be the intended behavior of touchesA, can it?  Is there
>something obvious (or nonobvious) that I'm missing, or is this a bug?

Jerry,

It is intended actually. The application for which I created this was an etoy implementation of the BouncingAtomsMorph. In this example, atoms might decide to look like a RedDot or look like a BlueDot to indicate their infection status. Testing, then, was interested in whether a given morph intersected something that *looked-like* a red or blue dot, BUT NOT whether it intersected the *real* RedDot or BlueDot (which were only suppliers of costume and, hopefully, were placed somewhere out of the way).

So, to use this, keep the original StarSketch off to the side somewhere and use copies or things that look like it for your real work.

OR

In Player>>touchesA: change
		(trueNeighbor == trueGoal or: [trueNeighbor == trueSelf]) ifFalse: [
to
		(trueNeighbor == trueSelf) ifFalse: [
		

Cheers,
Bob



More information about the Squeak-dev mailing list