# \[MX\] A few AS questions, should'nt be too hard

**URL:** <https://forum.kirupa.com/t/mx-a-few-as-questions-shouldnt-be-too-hard/39648>\
**Category:** Uncategorized\
**Created:** [January 9, 2004, 12:26pm UTC](https://forum.kirupa.com/t/mx-a-few-as-questions-shouldnt-be-too-hard/39648 "2004-01-09T12:26:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Elbudster](https://avatars.discourse-cdn.com/v4/letter/e/a698b9/32.png) [@Elbudster](https://forum.kirupa.com/u/Elbudster)\
**Post date:** [January 9, 2004, 12:26pm UTC](https://forum.kirupa.com/t/mx-a-few-as-questions-shouldnt-be-too-hard/39648/1 "2004-01-09T12:26:28Z")

</div>

I’m making a game that will eventually be like asteroids kinda. I have this line for a turret that rotates around with the mouse. For the turret that rotates im using the code:

[AS]onClipEvent (enterFrame) {  
myRadians = Math.atan2(\_root.\_ymouse-this.\_y, \_root.\_xmouse-this.\_x);  
myDegrees = Math.round((myRadians\*180/Math.PI));  
\_root.rad = myRadians;  
\_root.deg = myDegrees;  
\_root.rad = myRadians;  
\_root.deg = myDegrees;  
this.\_rotation = myDegrees+90;  
}  
[/AS]

The first question is how do you make it so that the turret thing rotates on an endpoint and not rotate by its center?

The second question is when I press spacebar the turret shoots a little MC but how do I make it fire in the direction of whatever the angle is. Like if myDegrees = 74 degrees how do I make it fire at a 74 degree angle?

Thanks,

Elbudster
