Difficult-Rocket/tests/hit_box_check.py

36 lines
530 B
Python
Raw Normal View History

2021-03-20 10:56:08 +08:00
"""
这个测试主要是为了测试关于旋转的按钮碰撞箱判定的
感谢孙老师/
下周就要学一次函数了
"""
2021-03-20 10:52:40 +08:00
import turtle
t = turtle
size = t.screensize()
screen = t.Screen()
2021-04-03 12:15:24 +08:00
def print_poi(x, y):
print(x, y)
this_t = turtle.clone()
this_t.hideturtle()
this_t.speed = 0
this_t.penup()
this_t.goto(x, size[1])
this_t.pendown()
this_t.goto(x, -size[1])
2021-04-03 12:15:24 +08:00
2021-03-20 10:52:40 +08:00
t.speed = 0
t.hideturtle()
screen.onclick(print_poi)
t.onclick(print_poi)
2021-04-03 12:15:24 +08:00
t.goto(10, 10)
t.goto(20, 100)
t.done()