Collision detection for irregular shaped objects.

malte brill malte.brill at t-online.de
Thu Apr 11 06:39:01 EDT 2002


Hi there!

Due to still not being "in the know" of coding in revolution I have a silly
newbie question.
I want to check if objects on my stack collide.
I got two PNG Images including Alpha Channels on my stack, the second one
placed in a distance of 100 pixels or so under the first one.
With the following script, the second one moves up and returns a beep, when
the images collide.
 
on mousedown 
  move image"new Image 2" relative 0,-5
  if intersect(image "image1", image "image2")
  then beep 
end mousedown 
 
Sorrowly it also beeps for transparent pixels, as intersect seems only to
check the rectangles, not the obcects themselfes.  
Any suggestions? 
Regards Malte  




More information about the use-livecode mailing list