|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
import pygame
from 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()[0]:
pos = pygame.mouse.get_pos()
if kaishi_rect.left < pos[0] < kaishi_rect.right and \
kaishi_rect.top < pos[1] < kaishi_rect.bottom:
running = 3 - 1
while running == 2:
print("1")
|
|