intersect . . . invisible images

Mark Waddingham mark at livecode.com
Fri Jul 14 05:37:15 EDT 2017


On 2017-07-14 11:20, Richmond Mathewson via use-livecode wrote:
> Oh dear, oh dear, oh dear . . .
> 
> There I am fooling around setting up an "exam" for my "kiddiewinks"
> when I discovered something quite unsuspected about intersect ;
> 
> So I have some code that goes something like this:
> 
> if intersect(img"A",img"B",4) then
>    add 1 to SCORE
>    set the vis of img "B" to false
> end if
> 
> now I am making img "B"invisible to that the gameplayer doesn't
> rack up points be performing a repeated intersect
> 
> BUT
> 
> the intersect CONTINUES registering with a hidden image

How about:

if the visible of img "B" and intersect(img "A", img "B", 4) then
     add 1 to SCORE
     set the vis of img "B" to false
end if

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list