Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python turtle shapes

I am drawing something with python turtle , i used the shape functions but the shapes overdraw the others before them (i can see the shapes moving) , and i get just the last shape:

`up()
goto(-200,-200)
down()
shape("circle")
shapesize(2,1,1)
fillcolor("black")
up()
goto(-300,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
up()
goto(-100,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")`

I am looking forward for your answers , thank you !

like image 260
Isu Avatar asked Oct 23 '25 18:10

Isu


1 Answers

turtle.shape changes the shape of the turtle as it's drawing. To actually draw that shape where it is, you need turtle.stamp():

up()
goto(-200,-200)
down()
shape("circle")
shapesize(2,1,1)
fillcolor("black")
stamp()
up()
goto(-300,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
stamp()
up()
goto(-100,-100)
down()
shape("circle")
shapesize(4,4,1)
fillcolor("black")
stamp()
like image 192
TemporalWolf Avatar answered Oct 26 '25 08:10

TemporalWolf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!