Use the
turtle.clone[
^] function to create the secondary image. You can then use the various positioning functions to make it move. There is some useful sample code at
The Beginner's Guide to Python Turtle – Real Python[
^].
This is not too difficult to do. First you need a second image to fly out of the first. I used a square shape as the primary and an oval as the flyer.
def flyout(x, y):
oval = cake2.clone()
oval.shape("egg.gif")
oval.penup()
oval.setpos(x, y)
oval.left(80)
for x in range(30):
oval.forward(10)
oval.right(5)
In the
clicked
function I call
flyout(0, 20)
to set the start position of the oval to just above the square. It then traverses an arc from that position ...
The above code is just a rough sample, you should modify it as necessary for your own requirements.