Difficult-Rocket/tests/many_test_of_hitbox.py

35 lines
540 B
Python
Raw Normal View History

2021-03-20 10:52:40 +08:00
2021-03-20 10:56:08 +08:00
"""
这个测试主要是为了测试关于旋转的按钮碰撞箱判定的
感谢孙老师/
下周就要学一次函数了
"""
2021-03-20 10:52:40 +08:00
import turtle
import random
t = turtle
size = t.screensize()
screen = t.Screen()
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-03-20 10:52:40 +08:00
t.speed = 0
t.hideturtle()
screen.onclick(print_poi)
t.onclick(print_poi)
2021-03-20 10:52:40 +08:00
t.goto(10,10)
t.goto(20,100)
t.done()