Hi, dear list!   :)

I have a single problem: I need to move the intersects sprites (from my
"mother sprite") from a start position to a end position. Imagine a first
sprite intersecting another sprite, this (another) intersects another and
this intersects another and...

Ok. First I create a list wich contain the number of all sprites. After I
need obtain the relative coord of each sprite in relation to the first and
so, set the new position to the mouseLoc.

I wrote this script:

on RightMouseDown me
  
  listaInt=[]  --create a empty list for the number of intersects sprites
  spriteDaVez=the spriteNum of me  
  spriteVetor=spriteDaVez
  posVetor=sprite(spriteVetor).loc
  add listaInt, spriteDaVez  -- put the clicked sprite into the list
  repeat with i=1 to 6
    if sprite(spriteDaVez).intersects(i) and i<>spriteDaVez and �
getOne(listaInt, i)=0 then 
      add listaInt, i
      set spriteDaVez=i
      set i=1
    end if    
  end repeat
  
  repeat while the RightMouseDown
    repeat with j=1 to count(listaInt)
      set vetor=posVetor-(sprite(getAt(listaInt,j)).loc)
      sprite(getAt(listaInt,j)).loc= (the mouseLoc)+vetor
      updateStage
    end repeat    
  end repeat  
end

--Obs.: I used only 6 sprites in this test

But when I move the sprite, the positions are crazy! The linear list is
correct, but I think my wrong be in the "vetor".

Excuseme for this single problem, but I am very tyred and can't think very
well now. :)
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