Solve my Problem and Win

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Synthlight
    Administrator
    FFR Simfile Author
    FFR Administrator
    • Nov 2002
    • 3057

    #1

    Solve my Problem and Win

    Help me solve my problem with this code and I will release an alpha version of a new concept I am working on.

    Here is the code...

    onClipEvent (mouseMove) {
    x=this._xmouse;
    trace("x mouse = "+x);
    y=this._ymouse*-1;
    trace("y mouse = "+y);
    angle = Math.atan(y/x)/(Math.PI/180);
    _root.angle = angle;
    if(x<0){angle+=180}
    if(x>=0&&y<0){angle+=360}
    _root.angletext=angle; // set text to show arrow angle
    _root.arrow._rotation=angle*-1; // set view of arrow
    updateAfterEvent();}

    This code figures out the angle of your mouse pointer in relation to a predefined axis. The code works great, no complaints here about the way it is written.

    Here is my issue with it:

    If you are to the right of the axis, you are at 0 degrees. If you are above the axis you are at 90 degrees. Below and you are at 270 degrees. To the left and you are at 180 degrees.

    Make sense? Hopefully yes..

    Now, what needs to change is for right to be 0 degrees. above to be 270 degrees. Below to be 90 degrees. Left 180 and right 0 degrees.

    Still make sense?

    Now change my code to think this way and I will release this mini-concept tomorrow on the site.

    Good luck.

    Cheers,

    Synthlight
  • Afrobean
    Admiral in the Red Army
    • Dec 2003
    • 13262

    #2
    Re: Solve my Problem and Win

    So basically, you want it to reflect over the x axis?

    I'm not familiar with that language, so I can't really help much. All I can add is that to reflect over x axis, you multiply Y by negative 1 I think.

    Comment

    • aperson
      FFR Hall of Fame
      FFR Simfile Author
      • Jul 2003
      • 3431

      #3
      Re: Solve my Problem and Win

      onClipEvent (mouseMove) {
      x=this._xmouse;
      trace("x mouse = "+x);
      y=this._ymouse*-1;
      trace("y mouse = "+y);
      angle = Math.atan(y/x)/(Math.PI/180);
      _root.angle = angle;
      if(x<0){angle=-1*angle+180}
      if(x>=0&&y>=0){angle=-1*angle+360}
      if(x>=0&&y<0){angle=math.abs(angle)}
      _root.angletext=angle; // set text to show arrow angle
      _root.arrow._rotation=angle*-1; // set view of arrow
      updateAfterEvent();}

      maybe.

      Comment

      • natetheffrer
        FFR Player
        • Oct 2004
        • 906

        #4
        Re: Solve my Problem and Win

        I see >=0

        your code is mad.

        EDIT: How does this have to do with ffr?

        Comment

        • Afrobean
          Admiral in the Red Army
          • Dec 2003
          • 13262

          #5
          Re: Solve my Problem and Win

          Originally posted by natetheffrer
          I see >=0

          your code is mad.
          greater than or equal to zero

          Comment

          • SqNtz_xoombotvx
            FFR Player
            • Jan 2006
            • 220

            #6
            Re: Solve my Problem and Win

            Did you try replacing all the += with -=?

            Comment

            • perkeyone
              FFR Player
              • Dec 2005
              • 240

              #7
              Re: Solve my Problem and Win

              im fairly sure if you set the x variable to -x it would work...
              or you could change all angles>1 to negative and add 360
              im pretty sure i just repeated what some one else said though

              Comment

              • jewpinthethird
                (The Fat's Sabobah)
                FFR Music Producer
                • Nov 2002
                • 11711

                #8
                Re: Solve my Problem and Win

                Needs more cosine.

                Comment

                • lord_carbo
                  FFR Player
                  • Dec 2004
                  • 6222

                  #9
                  Re: Solve my Problem and Win

                  Edit: **** this was a super bump haahahaah
                  Last edited by lord_carbo; 09-9-2007, 03:13 AM.
                  last.fm

                  Comment

                  • Magic_V2
                    RobMagic
                    • Jun 2006
                    • 638

                    #10
                    Re: Solve my Problem and Win

                    Originally posted by perkeyone
                    im pretty sure i just repeated what some one else said though
                    Then why bump?

                    Comment

                    • PsYcHoZeRoSk8eR
                      Threat Emulation
                      FFR Simfile Author
                      • May 2004
                      • 5184

                      #11
                      Re: Solve my Problem and Win

                      I'm pretty sure the poor man's way of dealing with this is to turn the monitor upside down or however it would need to be turned and such. but I doubt that will help here.

                      Originally posted by Lightdarkness
                      I'm light f**king darkness

                      Comment

                      • perkeyone
                        FFR Player
                        • Dec 2005
                        • 240

                        #12
                        Re: Solve my Problem and Win

                        Originally posted by Magic_V2
                        Then why bump?
                        that was an edit

                        Comment

                        Working...