SPlice wrote:when rotating the ship the turret wanders from where it should be. notice how it moves away from where it should be when the ship moves. The turret is offset because there will be groups of 4 turrets, so the x and y values that tell the turret image where to draw need to move around the center of the ship as the ship rotates. the turret is offset x+15, y+15 from the center where the ship rotates, somehow that offset needs to translate into a rotated vector or something. I really appreciate you taking the time to look at this, if your sick of it don't worry about it =/
Its the same as the equation you used to rotate the turret, but rearranged.
When you work out the angle of the turret to the mouse, you calculate the opposite and adjacent((yobject-ymouse) and (xobject-xmouse)) to calculate the angle between the turret and the mouse.
When positioning the turret on the ship, you know the angle, and initial opposite and adjacent, however to calculate the new opposite and adjacent, you need to work out the hypotenuse.
My maths isn't too hot but:
sin(angle) = opp/hyp
cos(angle) = adj/hyp
tan(angle) = opp/adj
so you can rearrange to get what you need.
I'm sure this could be more helpful, but at least i understood the question ><