Pygame第一个事件on_mouse_down & collidepoint
参考:
https://pygame-zero.readthedocs.io/en/stable/introduction.html
------------------------------------------------
import pgzrun
alien = Actor('alien')
alien.pos = 100,56
WIDTH = 500
HEIGHT = alien.height + 40
def draw():
alien.draw()
def on_mouse_down(pos):
if alien.collidepoint(pos):
print("Eek!")
else:
print("You missed me!")
pgzrun.go()
--------------------------------------------
def on_mouse_down(pos, button):
if button == mouse.LEFT and alien.collidepoint(pos):
print("Eek!")