I have some small sprites. I need examine if occur a intersection between 7
sprites. For example: The sprite 76 intersects the sprite 85. The sprite 85
intersects sprite 76 (the same) and, for example, the sprite 90... and in
the end, if I have 7 sprites intersected, I put a message.

I need examine the sprites how a conjunt, not how a All. If I have 4
intersected sprites in a conjunt and another 3 intersected sprites in
another conjunt, my verification is false; but if I have 7 intersected
sprites in a same conjunt, my return is TRUE.

I wrote this script:

global batman, listaInt
  set batman=void
  set listaEsquerda=[82,83,84,85,86,87,88,89,90,91,92]  --for example
  listaInt=[]  --create a empty list for the number of intersected sprites
  
  spriteDaVez=getAt(listaEsquerda,1)           
  add listaInt, spriteDaVez  -- put the clicked sprite into the list
  repeat with n=2 to (count(listaEsquerda))
    repeat with i=1 to (count(listaEsquerda))
      if sprite(spriteDaVez).intersects(getAt(listaEsquerda,i))=true and
(getAt(listaEsquerda,i))<>(spriteDaVez) and
getOne(listaInt,value(getAt(listaEsquerda,i)))=0 and
((sprite(spriteDaVez).intersects(72)=true) or
(sprite(spriteDaVez).intersects(73)=true)) then 
        set spriteDaVez=(getAt(listaEsquerda,i))
        add listaInt, (getAt(listaEsquerda,i))
        deleteAt listaEsquerda, i
        set i=1
        if count(listaInt)=7 then
          set i=count(listaEsquerda)
          set batman="ok"  -- my expected return
          alert batman
          abort
        end if
      end if    
    end repeat
    if count(listaInt) <> 7 then set listaInt=[]
    
    set spriteDaVez=(getAt(listaEsquerda,n))
  end repeat

Any help is appreciated.

Thanks in advance
Fabricio.

Fabricio Guedes Bissoli
Phasis Multimidia

55 32 3218-5343
55 32 9103-7978


       The only way to understand what mathematics means by infinity is to
comtemplate the extent of human stupidity.

                                                         Voltaire


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to