What if the ship is flying sideways, should the bullet fly straight up at 500 px/s? Or should it fly up and drift to the left?
My guess is that the second picture is correct?
In this case an easy solution is to apply two Bullet behaviors. One with speed 500 in the direction of the gun. And another with the ship velocity in the direction where the ship is moving.
You can get the values for the second behavior with these expressions:
shipVelocity = distance(0, 0, Ship.Physics.VelocityX, Ship.Physics.VelocityY)
shipMovingAngle = angle(0, 0, Ship.Physics.VelocityX, Ship.Physics.VelocityY)
.
Or instead of Bullet behaviors you can set bullet position with events.
When the bullet is spawned, save these values in instance variables: a1=bullet angle, s1=bullet speed, a2=ship moving angle, s2=ship speed.
Then on every tick do this:
Bullet Move s1*dt at angle a1
Bullet Move s2*dt at angle a2