1

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:

rocket.gif image

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!

  • 1
    Sadly, this is the expected behavior [according to the docs](https://docs.python.org/3/library/turtle.html#turtle.addshape). A few existing questions seem to cover this: [1](https://stackoverflow.com/questions/11277518/how-to-rotate-turtle-shape-in-python), [2](https://stackoverflow.com/questions/48082783/python-turtle-rotate-custom-cursor-image), [3](https://stackoverflow.com/questions/48483443/how-to-turn-turtle-shape-with-image). – ggorlen Mar 03 '23 at 05:46

0 Answers0