I'm currently working with Python's turtle module and I have created a custom turtle shape using the "turtle.register_shape()" method. Specifically, I have loaded a rocket image from a "rocket.gif" file and set it as my turtle shape using the "my_turtle.shape()" method. Here's the image I'm using:
However, I'm having trouble making the rocket image rotate along with the turtle as it moves. I've tried using the "my_turtle.right()" and "my_turtle.setheading()" methods to rotate the image in the appropriate direction, but it doesn't seem to work.
I've included some sample code below to demonstrate what I'm currently working with:
import turtle
turtle.register_shape("rocket.gif")
my_turtle = turtle.Turtle()
my_turtle.shape("rocket.gif")
while True:
my_turtle.forward(100)
my_turtle.left(90)
I would greatly appreciate any guidance or suggestions on how to make the rocket image rotate along with the turtle. Thank you in advance for your help!