用户:金钿森查看:0 回复:2 评论:0 创建时间:2020-08-03T21:06:08
【作品展示】

【作品介绍】
敲一敲鼠标
【作品源代码】
import pygame
import sys
LEFT = 1
a=0
running = True
screen = pygame.display.set_mode((1200, 1000))
while running:
screen.fill((0, 0, 0))
pygame.display.flip()
event = pygame.event.poll()
if event.type == pygame.QUIT:
running = False
pygame.quit()
elif event.type == pygame.MOUSEBUTTONDOWN and event.button == LEFT:
print("You pressed the left mouse button at (%d, %d)" % event.pos)
a+=1
elif event.type == pygame.MOUSEBUTTONUP and event.button == LEFT:
print("You released the left mouse button at (%d, %d)" % event.pos)
print(a)
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn