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