Page 1 of 1

Please help to fix this!

Posted: Sun Jan 20, 2013 11:41 am
by ahmedinvent24BUSGdU9
Hi all, Now i have 2 images, graphic line, and a button.

now i wrote in the code of the button

Code: Select all

move img "name" to the points of graphic line in 1 sec  

if intersect(img "name", image "name1", "opaque pixels") then
hide img "name1"        
   end if
now when image "name" moves and then intersect with image "name1" image "name 1" still visible

PLease how to fix this :) :)

Re: Please help to fix this!

Posted: Sun Jan 20, 2013 12:40 pm
by jmburnod
Hi ahmedinvent24BUSGdU9,

Try this. It is not perfect but does the job for two images.

Code: Select all

on mouseUp
   put the points of grc "line" into tListPoints -- 
   put the num of items of tListPoints into nbMax
   put round(1000/nbMax) into tStepTime
   repeat for each line tPoint in tListPoints
      move img "name" to tPoint in  tStepTime milliseconds  
         if intersect(img "name", image "name1") then
      hide img "name1"     
   else
      show     img "name1"
      end if 
   end repeat
end mouseUp
Best regards
Jean-Marc

Re: Please help to fix this!

Posted: Sun Jan 20, 2013 12:50 pm
by dave_probertGA6e24
Hi Ahmed,

The cause of it not working is that the movement happens before the check for intersection, not during it. JM's code will correct that.

Cheers,
Dave

Re: Please help to fix this!

Posted: Sun Jan 20, 2013 2:47 pm
by ahmedinvent24BUSGdU9
Thank you Jean-Marc and Dave

:D :)