为什么这段代码点击开始没有任何反应
import pygamefrom pygame.locals import *
import sys
pygame.init()
WIDTH = 600
HEIGHT = 300
screen = pygame.display.set_mode((WIDTH,HEIGHT))
pygame.display.set_caption("表情包闯关")
background = pygame.image.load(r'C:\Users\Administrator\Desktop\对话游戏\image\main_image.jpg').convert()
kaishi = pygame.image.load(r'C:\Users\Administrator\Desktop\对话游戏\image\1.jpg').convert()
kaishi_rect = kaishi.get_rect()
jieshu = pygame.image.load(r'C:\Users\Administrator\Desktop\对话游戏\image\2.jpg').convert()
jieshu_rect = jieshu.get_rect()
running = 3
kaishi_rect.left, kaishi_rect.top = (WIDTH - kaishi_rect.width) // 2, 50
screen.blit(kaishi, kaishi_rect)
pygame.display.flip()
if pygame.mouse.get_pressed():
pos = pygame.mouse.get_pos()
if kaishi_rect.left < pos <kaishi_rect.right and \
kaishi_rect.top < pos <kaishi_rect.bottom:
running = 3 - 1
while running == 2:
print("1")
这是一个游戏开始界面 点击开始游戏后没有任何反应
页:
[1]