我一直在编写一个简单的游戏。我正在尝试使我的一个精灵可点击,并loaddeath()
在点击时执行。
虽然我遇到了几个错误。
screen.blit(chinese, (randomx1, randomy1))
screen.blit(green, (randomx2, randomy2))
screen.blit(eden, (randomx3, randomy3))
screen.blit(obama, (randomx5, randomy5))
screen.blit(blue, (randomx6, randomy6))
#I want this object to be clickable
screen.blit(kevin, (randomx8, randomy8))
screen.blit(hud, (0, 0))
我的事件循环:
for event in pygame.event.get():
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
我需要添加什么?