Go Back   Flash Flash Revolution > General Discussion > Chit Chat
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
Old 06-22-2006, 10:39 PM   #1
Synthlight
Administrator
Founder, System Administrator
AdministratorFFR Simfile AuthorFFR Veteran
 
Synthlight's Avatar
 
Join Date: Nov 2002
Location: United States of America
Age: 50
Posts: 3,052
Default 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
Synthlight is offline   Reply With Quote
Old 06-22-2006, 10:43 PM   #2
Afrobean
Admiral in the Red Army
FFR Veteran
 
Afrobean's Avatar
 
Join Date: Dec 2003
Location: the moon
Age: 36
Posts: 13,262
Send a message via Skype™ to Afrobean
Default 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.
__________________
Afrobean is offline   Reply With Quote
Old 06-22-2006, 11:11 PM   #3
aperson
FFR Hall of Fame
Retired StaffFFR Simfile AuthorFFR Veteran
 
aperson's Avatar
 
Join Date: Jul 2003
Location: Houston
Posts: 3,428
Send a message via AIM to aperson
Default 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.
__________________

aperson is offline   Reply With Quote
Old 06-22-2006, 11:17 PM   #4
natetheffrer
FFR Player
 
natetheffrer's Avatar
 
Join Date: Oct 2004
Location: The Floor<Mendon<Rochester<New York
Age: 32
Posts: 906
Send a message via AIM to natetheffrer
Default Re: Solve my Problem and Win

I see >=0

your code is mad.

EDIT: How does this have to do with ffr?
__________________
natetheffrer is offline   Reply With Quote
Old 06-22-2006, 11:19 PM   #5
Afrobean
Admiral in the Red Army
FFR Veteran
 
Afrobean's Avatar
 
Join Date: Dec 2003
Location: the moon
Age: 36
Posts: 13,262
Send a message via Skype™ to Afrobean
Default Re: Solve my Problem and Win

Quote:
Originally Posted by natetheffrer
I see >=0

your code is mad.
greater than or equal to zero
__________________
Afrobean is offline   Reply With Quote
Old 06-23-2006, 12:06 AM   #6
SqNtz_xoombotvx
FFR Player
 
SqNtz_xoombotvx's Avatar
 
Join Date: Jan 2006
Location: Bozeman, MT
Age: 37
Posts: 220
Send a message via AIM to SqNtz_xoombotvx Send a message via MSN to SqNtz_xoombotvx Send a message via Yahoo to SqNtz_xoombotvx
Default Re: Solve my Problem and Win

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

SqNtz_xoombotvx is offline   Reply With Quote
Old 09-8-2007, 07:03 PM   #7
perkeyone
FFR Player
 
perkeyone's Avatar
 
Join Date: Dec 2005
Age: 34
Posts: 240
Default 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
perkeyone is offline   Reply With Quote
Old 09-8-2007, 07:16 PM   #8
jewpinthethird
(The Fat's Sabobah)
Retired StaffFFR Music ProducerFFR Veteran
 
jewpinthethird's Avatar
 
Join Date: Nov 2002
Location: Palm Springs, California
Posts: 11,711
Send a message via AIM to jewpinthethird
Default Re: Solve my Problem and Win

Needs more cosine.
jewpinthethird is offline   Reply With Quote
Old 09-9-2007, 04:10 AM   #9
lord_carbo
FFR Player
 
lord_carbo's Avatar
 
Join Date: Dec 2004
Location: fighting villains from afar, NJ
Age: 32
Posts: 6,222
Send a message via AIM to lord_carbo
Default Re: Solve my Problem and Win

Edit: **** this was a super bump haahahaah
__________________
last.fm

Last edited by lord_carbo; 09-9-2007 at 04:13 AM..
lord_carbo is offline   Reply With Quote
Old 09-9-2007, 05:00 AM   #10
Magic_V2
RobMagic
FFR Veteran
 
Magic_V2's Avatar
 
Join Date: Jun 2006
Location: Las Vegas
Age: 36
Posts: 638
Send a message via MSN to Magic_V2
Default Re: Solve my Problem and Win

Quote:
Originally Posted by perkeyone View Post
im pretty sure i just repeated what some one else said though
Then why bump?
__________________

Magic_V2 is offline   Reply With Quote
Old 09-9-2007, 06:16 AM   #11
PsYcHoZeRoSk8eR
Network Security Analyst
FFR Simfile AuthorFFR Veteran
 
PsYcHoZeRoSk8eR's Avatar
 
Join Date: May 2004
Location: ɥɔʇɐdı sʞuɐɥʇ
Age: 36
Posts: 5,183
Send a message via AIM to PsYcHoZeRoSk8eR Send a message via MSN to PsYcHoZeRoSk8eR
Default 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.
__________________

Quote:
Originally Posted by Lightdarkness
I'm light f**king darkness
PsYcHoZeRoSk8eR is offline   Reply With Quote
Old 09-9-2007, 01:07 PM   #12
perkeyone
FFR Player
 
perkeyone's Avatar
 
Join Date: Dec 2005
Age: 34
Posts: 240
Default Re: Solve my Problem and Win

Quote:
Originally Posted by Magic_V2 View Post
Then why bump?
that was an edit
perkeyone is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 08:51 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright FlashFlashRevolution