Shooting a ball from a moving image sprite

So I have been working with this game and there is a pirate ship that I want to shoot a canon ball from, but the pirate ship is always moving. How do I get the ball to shoot in the direction the pirate ship is pointing and only appear when it is shot?

Thank you!

Welcome
Have you read Creating Animated Apps ?

I would use the Ball.MoveTo Block (as shown in figure 17.4) with the Clock.TImer. The x, y coordinates used should be the coordinates of the pirate ship. That might do what you want it to do

Im not sure that would work since I am using a button to fire it, though would I have to set the heading of the image sprite equal to the pirate ship heading? because I tried that and it didn't work

Did you try to using the MoveTo as recommended? You do not have to set the heading of the image sprite equal to the pirate ship. I expect it will. I don't think you have to 'point' in the same direction.

We cannot see exactly what you have coded so far. You might post your relevant Blocks. If you cannot get the results you need if the Blocks are shared, someone might post a specific solution.

Are you 'shooting' the image sprite at the pirate ship? (instead of a Ball?)

Export your .aia file and upload it here.
export_and_upload_aia