# Getting direction of bullet based on angel of something

**URL:** <https://forum.kirupa.com/t/getting-direction-of-bullet-based-on-angel-of-something/332260>\
**Category:** flash\
**Created:** [March 26, 2014, 9:15am UTC](https://forum.kirupa.com/t/getting-direction-of-bullet-based-on-angel-of-something/332260 "2014-03-26T09:15:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![silverneo188](https://avatars.discourse-cdn.com/v4/letter/s/bbe5ce/32.png) [@silverneo188](https://forum.kirupa.com/u/silverneo188)\
**Post date:** [March 26, 2014, 9:15am UTC](https://forum.kirupa.com/t/getting-direction-of-bullet-based-on-angel-of-something/332260/1 "2014-03-26T09:15:55Z")

</div>

Thread title pretty much speaks for itself. I have a movieclip, which is a line, and it rotates with some actionscript

```auto

this._rotation += 1;

```

now I am wanting to get the xspeed and yspeed for the bullet based on it’s rotation.  
This is what I currently have for the bullet:

```auto

onClipEvent(load)
{
	var maxSpeed:Number = 3;
	var angle:Number = _root.angleClip._rotation;
	var ySpeed:Number = Math.sin(angle) * this.maxSpeed;
	var xSpeed:Number = Math.cos(angle) * this.maxSpeed
}
onClipEvent(enterFrame){
	this._x+= this.xSpeed;
	this._y+= this.ySpeed;
}

```

but all this does is send it off in a random direction. Think of what I’m trying to do as if it was a top down shooter where you fired towards your cursor. But instead of a moving character it’s a stationary point and instead of the mouse it’s a constantly rotating angle. Kind of like an automated turret.
