Isu
Isu

Reputation: 361

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 !

Upvotes: 4

Views: 12473

Answers (2)

Yair Ron
Yair Ron

Reputation: 11

use the turtle.stamp() function

Upvotes: 1

TemporalWolf
TemporalWolf

Reputation: 7952

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()

Upvotes: 3

Related Questions