2
我无法找出一种方法来检测玩家是否在Pygame的矩形内点击过。我试图在Python中点击矩形的测试
self.mouserect=(pygame.mouse.get_pos(), 8,8)
再后来
if self.click: #(this is true if mouse button is down)
if self.mouserect.colliderect(self.a_thing_to_click_on.rect):
do_stuff
但是这给了我一个AttributeError: '元组' 对象有没有属性 'colliderect'。我究竟做错了什么?
这给了我TypeError:参数必须是矩形样式对象... – Alex
关于什么行到底? – Ikke