something like this.

```
public function shoot(x:Int, y:Int, direction:String, speed:Int):Void
{
var dx = x;
var dy = y;
switch(direction)
{
case "left":
dx += -1;
dy += 0;
case "up":
dx += 0;
dy += -1;
case "right":
dx += 1;
dy += 0;
}
var rangle = radianAngle(x, y, dx, dy);
velocity.set(Math.cos(rangle) * speed, Math.sin(rangle) * speed);
}
private function radianAngle(x1:Float, y1:Float, x2:Float, y2:Float):Float
{
return Math.atan2(y2 - y1, x2 - x1);
}
```

This is just to give you the math needed for the getting the angle. You should change the code to work with your code.

]]>https://api.haxeflixel.com/flixel/math/FlxVelocity.html#velocityFromAngle

import flixel.math.FlxVelocity;

...

var angle = 90;

var speed = 1500;

bullet.velocity = FlxVelocity.velocityFromAngle(angle, 1500);