35 lines
500 B
Python
35 lines
500 B
Python
|
|
|
|
import turtle
|
|
import time
|
|
|
|
human = (0.00, 100)
|
|
lion1 = (100, 0.00)
|
|
angle1 = 0
|
|
|
|
angle = 240
|
|
|
|
turtle.pensize(3)
|
|
|
|
turtle.color("black")
|
|
turtle.penup()
|
|
turtle.goto(human)
|
|
turtle.dot(2, "red")
|
|
turtle.pendown()
|
|
turtle.setheading(angle)
|
|
turtle.fd(100)
|
|
|
|
human = turtle.position()
|
|
print(human)
|
|
|
|
turtle.color("green")
|
|
turtle.penup()
|
|
turtle.goto(lion1)
|
|
turtle.dot(2, "black")
|
|
turtle.pendown()
|
|
angle1 = turtle.towards(human)
|
|
turtle.setheading(angle1)
|
|
turtle.forward(15)
|
|
lion1 = turtle.position()
|
|
|
|
turtle.done() |