4 Replies Latest reply on May 26, 2007 10:30 AM by kglad

    Mouse advoider

    Ashpotter
      I have never been taught actionscript. For a "don't touch the wall with the cursor" game, it is ok to make the path and have the code target the path and have the path have this code?
      Will this work?
        • 1. Re: Mouse advoider
          cpgenius
          Mmm could you rephrase that?
          • 2. Re: Mouse advoider
            Level 7

            I assume you mean to have a movieclip which represents the path to
            follow and want to attach the code below to that movieClip. Could work,
            but then it would only 'measure' the tip of the cursor which would make
            for an easy game or a real narrow path to move along.

            For a fast solution,p ersonally I would have a movieClip follow the
            mouse with the startDrag() method of the movieclip class (see helpfiles)
            and have it check if it hits the walls of the maze with the hitTest()
            method of the movieclip class

            HTH,
            Manno


            Ashpotter wrote:
            > I have never been taught actionscript. For a "don't touch the wall with the
            > cursor" game, it is ok to make the path and have the code target the path and
            > have the path have this code?
            > Will this work?
            >
            > on(RollOut) {
            > gotoandstop (1)
            > }
            >


            --
            aloft
            Hoge der A 20a
            9712AD Groningen
            The Netherlands
            info@aloft.nl
            http://www.aloft.nl
            • 3. Re: Mouse advoider
              Ashpotter Level 1
              I do not understand the hit test function at all. I looked at a few sites and the scripts just confused me. My new idea is to have the Background have a
              on(RollOver){
              gotoandstop(1)
              //forces the player to start over
              }

              and have paths be buttons. For some reason, if the buttons are placed in layers higher than the background, these buttons override the bottom ones. Then, i'll assign these as on(Release) {gotoandstop (1)} so that the player will not be able to cheat. The advancing button would have a on rollover advance to next stage

              is this better?
              • 4. Re: Mouse advoider
                kglad Adobe Community Professional & MVP
                that should be rollOut and gotoAndStop(1) assuming your button is the on the timeline you want to send to its frame 1.