5 Replies Latest reply on Sep 28, 2009 8:08 AM by kglad

    Maze game help

    Marker88

      onClipEvent (enterFrame) {
      if (this.hitTest(_root.wall4)){
      _root.gotoAndStop(3)
      unloadMovie(this);
      }
      }

       

      i use that, and when i make it like a whole symble and when i put the thing inside (for a maze game) it automaticly goes to 3, how do i stop that so it only goes when i hit the lines

        • 1. Re: Maze game help
          kglad Adobe Community Professional & MVP

          "i use that, and when i make it like a whole symble and when i put the thing inside (for a maze game) it automaticly goes to 3, how do i stop that so it only goes when i hit the lines"

           

          you may understand that (run-on) sentence but it's not likely anyone else will.

           

          but if that code is attached to a movieclip that's a child of _root.wall4, the hitTest will always resolve to true.  also, the hitTest will resolve to true if the bounding rectangles of _root.wall4 and the movieclip, to which that code is attached, intersect.

          • 2. Re: Maze game help
            Marker88 Level 1

            well how do i amke it so its only the symble itself, not inculding the boudries

            • 3. Re: Maze game help
              kglad Adobe Community Professional & MVP

              the simplest way with rectilinear boundaries (like walls) is to make each wall a seperate movieclip and not make two or more walls one movieclips.

              1 person found this helpful
              • 4. Re: Maze game help
                Marker88 Level 1

                thats not possible because some i want moving... and that sounds even more complex

                • 5. Re: Maze game help
                  kglad Adobe Community Professional & MVP

                  whether they're moving or not makes no difference.  they can all move in lockstep.

                   

                  but if you don't want to use 1 movieclip per wall then you'll need to use a shape-based hittest which is much more complicated than the solution i suggested.  you can check gskinner's hitdetection class to get an idea of how that would work.

                  1 person found this helpful