while life > 0 or scores < 10:
x_k = kat.xcor()
y_k = kat.ycor()
k_toX = random.randint(-100, 100)
k_toY = random.randint(-100, 100)
if x_k + k_toX >= 280 or x_k + k_toX <= -280:
k_toX = k_toX * (-1)
if y_k + k_toY >= 250 or y_k + k_toY <= -280:
k_toY = k_toY * (-1)
kat.goto(x_k + k_toX, y_k + k_toY)
if scores >= 1:
kat.shape('angry_kat.gif')
if p.distance(kat) < kd and scores >= 1 == True:
p.shape('d.gif')
life = life - 1
print("XP: " + str(life))
else:
p.shape('p.gif')
counter = counter + 1
if counter > 15:
e.hideturtle()
e.setposition(random.randint(-300, 300), random.randint(-200, 200))
e.showturtle()
counter = 0
if p.distance(e) < 60 and e.isvisible() == True:
e.hideturtle()
scores = scores + 1
print("Очки:" + str(scores))
screen.listen()