Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import *
- while True:
- tri = Turtle()
- turtle = Turtle()
- tri.pu()
- tri.pencolor("white")
- tri.color("black")
- tri.shape("turtle")
- tri.bk(400)
- turtle = Turtle()
- turtle.pu()
- turtle.pencolor("white")
- turtle.shape("square")
- turtle.color("white")
- turtle.pu()
- turtle.speed(0)
- tri.speed(0)
- turtle.shapesize(100,100,00)
- setheading(towards(turtle))
- while tri.distance(turtle) > 10:
- turtle.ondrag(turtle.goto)
- tri.setheading(tri.towards(turtle))
- tri.fd(5)
- clearscreen()
- from turtle import Turtle, Screen
- a = Turtle(shape="square")
- a.color("red")
- a.width(6)
- b = Turtle(shape="circle")
- b.color("green")
- b.width(3)
- b.goto(-300, 0)
- b.dot()
- a.goto(-300, 0)
- a.dot()
- a.goto(300, 0)
- b.goto(300, 0)
- screen = Screen()
- screen.exitonclick()
- from turtle import Turtle, Screen
- tri = Turtle(shape="turtle")
- tri.color("black")
- tri.pu()
- turtle = Turtle(shape="square")
- turtle.shapesize(4)
- turtle.color("pink")
- turtle.pu()
- def drag_handler(x, y):
- turtle.ondrag(None)
- turtle.goto(x, y)
- turtle.ondrag(drag_handler)
- turtle.ondrag(drag_handler)
- tri.bk(400)
- while tri.distance(turtle) > 10:
- tri.setheading(tri.towards(turtle))
- tri.fd(5)
- screen = Screen()
- screen.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement