3 Replies Latest reply on Sep 21, 2006 7:54 PM by kglad

    Hit Detection Problems...

    se1zure
      I am still fairly new to actionscript, but am learning by working on small, simple games..

      I am able to do "hit detection" with movie clips, but the problem is, when i draw a movie clip, it forms a box around the mc. So if the user hits any part of the "box" they lose... I want it to be JUST the drawing that hit detects, not the surrounding area made by the box...

      anyone have any idea>
        • 2. Re: Hit Detection Problems...
          se1zure Level 1
          I can't get this to work for some reason... So far i have 2 movie clips, a squiigly line, and a ball. THe ball mc is called "target" and the squiggly line mc is called player.

          the link to download an example is not working, as flash can't read the file.

          Here, however is what i have tried.. do i need flash 8 by any chance?

          onClipEvent (enterFrame) {

          if (CollisionDetection.checkForCollision(player,target,120,_root.player)) {
          gotoAndStop(2);
          }

          }


          and i have set the target mc to move down the y axis, into the line. It just ends up going thorugh it however! Please help... or is there any other method!?
          • 3. Re: Hit Detection Problems...
            kglad Adobe Community Professional & MVP
            yes, you need flash 8. skinner's collision detection and the shape-based hit function i developed both use the bitmap class which is not supported before flash 8.

            the only work-around for earlier versions is to use several (more or less) rectangular movieclips to approximate the shape of the movieclips that you want to check for collisions.