Hope someone can help me - I'm going nuts here.....

Have just come back to a game I was making using collision detection from the 
Director-Online site (Charles Forman or GAry Rosensweig's I think). Analyses all 
pixels of a colour type to make a very accurate mask. 

Problem is, I have an error coming up where it was OK before:

Handler not found in object:
otherPoint = sprite(hitSprites[s]).mapStageToMember(myPoint)

This used to work fine. The code is on a ball sprite (bitmap), checking against a 
bitmap background. It only occurs when you move the mouse cursor into the ball (so it 
can be dragged). From what I can see, the value myPoint (see code below) suddenly 
becomes VOID. I can't see why. 

CODE:

<snip>

repeat with s = 1 to hitSprites.count
    -- skip self
    if sprite(hitSprites[s]) = me.spriteNum then next repeat
    -- first check for a simple intersedt
    if sprite hitSprites[s] intersects me.spriteNum then 
      -- loop through keypoints
      repeat with i = 1 to pPoints.count
        -- get stage location of a keypoint
        myPoint = sprite(me.spriteNum).mapMemberToStage(pPoints[i])
        -- figure out which pixel this corresponds to in other sprite
        otherPoint = sprite(hitSprites[s]).mapStageToMember(myPoint)   
--------------error
        -- see if it corresponds to any point at all
        if not voidP(otherPoint) then
          -- get color of pixel there
          pixelColor = sprite(hitSprites[s]).member.image.getPixel(otherPoint)
          --put pixelcolor
          -- if a non-white pixel, then there has been a collision
          if pixelColor <> rgb(0,102,204) then return hitSprites[s]
        end if
      end repeat
    end if
  end repeat

</snip>

I can't seem to find the problem. Can someone help me or point me in the right 
direction. I  also don't see a 'handler' being referenced in the script error 
line.......

:(

Leon



[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