1 - Create a variable called angle and set it to 0. This will represent a value of 0 to 359.
2 - When a direction key is pressed, add/subtract a value from angle depending on how much you want the turret to turn.
3 - Set the sprites angle to the value in angle.
4 - When angle >= 360, set angle = angle - 360. This keeps angle within the 0 to 359 values.
5 - Set the angle of the spawned "bullet" items to the same value as the turret.