About character movements
get the mouse postilion. you know the ship position, from those two points you can calculate the angle to the mouse. rotate your ship by that amount.
Given the new forward direction u as the *normalized* difference between your two positions. You can find an orthogonal vector to u by simply swapping the elements and making one negative. E.g. v = ( -u.y, u.x ). These two vectors define your new orientation matrix R = ( u v ) assuming the local x-axis is your ship's forward direction. I would expect Allegro to provide an API to also set a rotation matrix and not only an angle. This is the standard approach for this problem and doesn't involve any trigonometry and it also extends to 3D.
The new angle would be simply alpha = atan2( u.y, u.x ). I would try to avoid angles if you can though and work with vectors and matrices instead.
It helps a lot if you also explicitly state what part you are stuck. Norman responded to the general question that you asked. Maybe you didn't know that you could ask the mouse position, or you didn't understand you needed to construct a line between them.Seriously @norman barrows. I know that, but thing is how to calculate that angle. I need the formula for that. I know the 2 positions. I have a function available to rotate my ship. But it requires an angle, an angle between my ship and my mouse cursor. I just want the formulae to find that ANGLE.
All these and others were not excluded in your question.
Do not need to be nasty to people who is helping you. You are not entitled to an answer.
A quick google lookup yields this: http://math.stackexchange.com/questions/1201337/finding-the-angle-between-two-points
Both have a (x, y) position.
In the picture, the X is the horizontal difference between both positions (ie subtract x position of the mouse from, x position of the ship), and the Y is the vertical difference (idem, but with y of mouse and y of ship)
now, by definition, tan(theta) = Y/X, where 'theta' is the angle you are looking for, and Y/X is (you guessed it), divide Y by X.
This "tan" function is a bit nasty, but no worries, smart people have invented 'atan' which does the opposite of 'tan'.
If "tan(theta) = Y/X", then "theta = atan(Y/X)". This is a whole lot better, Y/X can be computed, "atan" exists in your programming library, and the result is 'theta', the angle you're looking for.
There are a few caveats, Y/X doesn't exist if X==0 (can't divide by 0), so you have to special case this. Not a major problem, if X==0, then the difference in x positions between the ship and the mouse is 0, ie they are vertically aligned.
That should be solvable.
Secondly, the atan function doesn't return an angle from 0 to 360 (or 0 to 2*PI, if it speaks radians), you get a smaller range a few times. This can be solved by checking the sign of X and/or Y (so you know in which quadrant the mouse is, relative to the ship), and adjusting the angle separately for each quadrant.
Dirk Gregorius and Alberth provided the answers already, but to try to give some more context...
First, you need the delta (difference) vector from the player to the mouse cursor.
Delta = PlayerPostion - MouseCursorPosition
Then you can use atan2 to find the angle.
Angle = atan2(Delta.y, Delta.x)
This tells you the angle the player should be facing, and you can set it to that.
Note that this does not tell you the amount to rotate, but the actual rotation angle the player should end up with. You most likely have some sort of SetAngle or SetRotation function available you can use.