| | How to rotate a character with the mouse | |
|
| Author | Message |
|---|
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | Subject: 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.  ~RED |
|
 | |
WweTk Newly Hatched Duck

Posts: 8 Join date: 2010-02-12
 | Subject: 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....  " longdesc="98" /> ~Wwetk |
|
 | |
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | Subject: 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....
" longdesc="98" /> ~Wwetk |
What the heck was that? I was asking for actual explanations. Not freaking HINTS. |
|
 | |
09op Clothing Store Worker

Posts: 152 Join date: 2009-08-16 Age: 14 Location: Australia
 | Subject: 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  . I still need to find one I can translate into Smartfox. But I will keep looking Red! |
|
 | |
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | |
 | |
09op Clothing Store Worker

Posts: 152 Join date: 2009-08-16 Age: 14 Location: Australia
 | Subject: Re: How to rotate a character with the mouse Wed Jul 07, 2010 1:53 am | |
| |
|
 | |
Gamerboy Clothing Store Worker

Posts: 159 Join date: 2009-12-23
 | Subject: 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. |
|
 | |
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | Subject: 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. |
|
 | |
Gamerboy Clothing Store Worker

Posts: 159 Join date: 2009-12-23
 | Subject: 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. |
|
 | |
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | Subject: 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. |
|
 | |
09op Clothing Store Worker

Posts: 152 Join date: 2009-08-16 Age: 14 Location: Australia
 | Subject: 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 |
|
 | |
RED Legendary Duck

Posts: 1532 Join date: 2009-09-16
 | Subject: 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! |
|
 | |
| | How to rotate a character with the mouse | |
|