Waddle Village
www.WaddleVillage.net


This is our old forum, make sure to visit us at our new one! www.WaddleVillage.net
 
HomeFAQRegisterLog in

Share | 
 

 How to rotate a character with the mouse

View previous topic View next topic Go down 
AuthorMessage
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: How to rotate a character with the mouse    Tue Jul 06, 2010 3:41 pm

I was just wondering, in actionscript 2, how do you rotate the character with your mouse in the game, like how the walking sprites do in Club Penguin and Adega?
Please give a good explanation on how, and thanks in advance.
Wink
~RED
Back to top Go down
http://nerdymations.webs.com
WweTk
Newly Hatched Duck


Posts: 8
Join date: 2010-02-12

PostSubject: Re: How to rotate a character with the mouse    Wed Jul 07, 2010 12:23 am

Its Not Really Possible In AS2 Scripting MOst Use AS3 For That and it is complicated depending on what proggram your using lets say your using Macromedia Flash 8. You would need to make all the positions then make the main position a movie clip then insert the other positions in order South,south-west,west and so on...
You must also make frame labels then find out some stuff about the A and Y axis and Use AS3 coding like i said its complicated dont worry if you dont get any of it im just explaining most of it.

By the way if you search google you might find some sites that tell you, that you can spin your object around that usually means spinning it a round in a circle like 90 degrees. You should type on google rotate object to point to mouse or something like that.

Anyway Hope I Gave You Alittle Clue....

Indeed ><img src=" longdesc="98" />
~Wwetk
Back to top Go down
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: Re: How to rotate a character with the mouse    Wed Jul 07, 2010 12:56 am

WweTk wrote:
Its Not Really Possible In AS2 Scripting MOst Use AS3 For That and it is complicated depending on what proggram your using lets say your using Macromedia Flash 8. You would need to make all the positions then make the main position a movie clip then insert the other positions in order South,south-west,west and so on...
You must also make frame labels then find out some stuff about the A and Y axis and Use AS3 coding like i said its complicated dont worry if you dont get any of it im just explaining most of it.

By the way if you search google you might find some sites that tell you, that you can spin your object around that usually means spinning it a round in a circle like 90 degrees. You should type on google rotate object to point to mouse or something like that.

Anyway Hope I Gave You Alittle Clue....

Indeed ><img src=" longdesc="98" />
~Wwetk

What the heck was that? I was asking for actual explanations. Not freaking HINTS.
Back to top Go down
http://nerdymations.webs.com
09op
Clothing Store Worker


Male Posts: 152
Join date: 2009-08-16
Age: 14
Location: Australia

PostSubject: Re: How to rotate a character with the mouse    Wed Jul 07, 2010 1:46 am

Lol I'd like to know this too. I did read about this but I dont know what its called. My original Penguin Chat 3 had this but it was a very complicated code Very Happy. I still need to find one I can translate into Smartfox. But I will keep looking Red!
Back to top Go down
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: Re: How to rotate a character with the mouse    Wed Jul 07, 2010 1:51 am

09op wrote:
Lol I'd like to know this too. I did read about this but I dont know what its called. My original Penguin Chat 3 had this but it was a very complicated code Very Happy. I still need to find one I can translate into Smartfox. But I will keep looking Red!

Thanks, dude. Clap!
Back to top Go down
http://nerdymations.webs.com
09op
Clothing Store Worker


Male Posts: 152
Join date: 2009-08-16
Age: 14
Location: Australia

PostSubject: Re: How to rotate a character with the mouse    Wed Jul 07, 2010 1:53 am

No problem.
Back to top Go down
Gamerboy
Clothing Store Worker


Posts: 159
Join date: 2009-12-23

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 4:34 pm

My game uses only AS2, not AS3. Anyway. for the directions, as Flash doesn't really support 3D I have each sprite/movieclip have eight directions. This is done in such a way each direction is a frame, with the required image.

I work out where the mouse is relative to the character (or point moving to), then use Math.atan2 to work out the number of radians the angle is. Convert to degrees, then get a frame number from that. Nothing too complicated, won't start copy and pasting code though.
Back to top Go down
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 7:23 pm

Gamerboy wrote:
My game uses only AS2, not AS3. Anyway. for the directions, as Flash doesn't really support 3D I have each sprite/movieclip have eight directions. This is done in such a way each direction is a frame, with the required image.

I work out where the mouse is relative to the character (or point moving to), then use Math.atan2 to work out the number of radians the angle is. Convert to degrees, then get a frame number from that. Nothing too complicated, won't start copy and pasting code though.

Btw, your game needs to be fixed. It's not working.
Back to top Go down
http://nerdymations.webs.com
Gamerboy
Clothing Store Worker


Posts: 159
Join date: 2009-12-23

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 7:36 pm

I know, I used an extension for the dynamic SWF's however it's not supported on the server. Now I'm in the process of recoding it, so it works without using dynamically created SWFs.
Back to top Go down
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 8:47 pm

Gamerboy wrote:
I know, I used an extension for the dynamic SWF's however it's not supported on the server. Now I'm in the process of recoding it, so it works without using dynamically created SWFs.

Okay, thanks Gamerboy.
Back to top Go down
http://nerdymations.webs.com
09op
Clothing Store Worker


Male Posts: 152
Join date: 2009-08-16
Age: 14
Location: Australia

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 9:28 pm

Hey, I actualy found the code, but i'm only gonna give it to Red. But i'm not home right now Red
Back to top Go down
RED
Legendary Duck


Male Posts: 1532
Join date: 2009-09-16

PostSubject: Re: How to rotate a character with the mouse    Sat Jul 17, 2010 10:36 pm

09op wrote:
Hey, I actualy found the code, but i'm only gonna give it to Red. But i'm not home right now Red

OK, thanks! Very Happy
Back to top Go down
http://nerdymations.webs.com
 

How to rotate a character with the mouse

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» Fleet Control Using Keyboard And Mouse
» Character of the Battlegrounds.
» Favorite Nintedo Character?
» In-Game Names with Special Character's?
» Fuse's Fall 2 Character Submissions

Permissions in this forum:You cannot reply to topics in this forum
Waddle Village :: *CLOSED* www.WaddleVillage.net *CLOSED* :: Coding-