[Squeakland] overlapsAny:, having trouble using
Scott Wallace
scott.wallace at squeakland.org
Mon Jul 4 22:23:21 PDT 2005
Hi, Dave,
Yes, please do post the project somewhere, and I (and others) will be
glad to have a look at it.
Your #makeTargets: code looks fine and ought to work. Indeed, I just
now tried something equivalent to it in my example and it worked just
as well as if I'd created the siblings manually.
I think perhaps you intended to include another code snippet into
your email, the one that queries "altColDetectMethod," as per your
penultimate paragraph, but omitted it. I presume that will be
present in the project you post, but if not, please send that along
as well.
We'll get to the bottom of this...
Cheers,
-- Scott
PS: How old are the kids you're working with?
PPS: By the way, fwiw, you can actually achieve the same effect as
your #makeTargets entirely within the tile-script regime, without
needing to resort to textual scripting, using code like the following
to create, add, and position each sibling:
At 9:01 PM -0700 7/4/05, Dave Briccetti wrote:
>Scott, thanks. I like the example, and it works for me in 3.8 6665.
>"Indicate all siblings" (thanks for the tip) does indicate that all
>the objects are siblings. I don't know what could be the trouble
>except that the objects are dynamically generated with Morph
>makeSiblings: :
>
>makeTargets
>| morph |
> self removeTargets.
> morph _ Target costume.
> targets _ morph makeSiblings: self getNumTargetsRequested.
> Transcript show: targets class; cr.
>
> targets do: [:n |
> n position: (500 atRandom @ 500 atRandom).
> n show.
> ].
> ^ self
>
>The logic works if I use "color sees," as you can see in this script
>that uses one of the two approaches depending on the value of the
>"altColDetectMethod" variable.
>
>Perhaps I could post the project somewhere and you, or someone,
>could take a look at it. I'd love to have feedback anyway, as I'm
>trying to teach some of these things to kids and I'd like to know if
>there are better ways of doing things.
>
>Dave
>
>Scott Wallace wrote:
>
>>Hi, Dave,
>>
>>Works for me -- see e.g. the attached project.
>>
>>Are you certain you are making "true siblings" (olive halo handle)
>>rather than simple "deep copies" (bright green halo handle)?
>>
>>If ever in doubt about which objects on the screen are actually
>>siblings of one another, use "indicate all siblings" from the
>>"siblings..." submenu of the halo menu of one of them, and you will
>>be given visual feedback showing all the objects on the screen that
>>are actual siblings of the chosen one.
>>
>>Cheers,
>>
>> -- Scott
>>
>>At 12:51 PM -0700 7/4/05, Dave Briccetti wrote:
>>
>>>Hi. overlapsAny looks like a very useful feature. I can't get it
>>>to work. It works with the Morph I give it, but not siblings of
>>>that Morph. Are there some commonly-made mistakes, or is it
>>>perhaps not working? Thanks.
>>>
>>>Dave Briccetti
>>>Lafayette, California
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://squeakland.org/pipermail/squeakland/attachments/20050704/e442683e/attachment-0001.htm
-------------- next part --------------
A non-text attachment was scrubbed...
Name: P566E175A_2
Type: image/png
Size: 66084 bytes
Desc: not available
Url : http://squeakland.org/pipermail/squeakland/attachments/20050704/e442683e/P566E175A_2-0001.png
More information about the Squeakland
mailing list