马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
报错:pygame.error: Couldn't open Gobang/chess_manual.jpg
换成其他的图片也打不开import pygame
import sys
import random
import time
from pygame.locals import *
pygame.init()
pygame.mixer.init()
bg_size = width,height = 446,446
screen = pygame.display.set_mode(bg_size)
pygame.display.set_caption("五子棋")
background = pygame.image.load("Gobang/chess_manual.jpg").convert_alpha()
pygame.mixer.music.load("Gobang/bg_music.mp3")
pygame.mixer.music.set_volume(0.3)
def main():
pygame.mixer.music.play(-1)
running = True
while running:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
screen.blit(background,(0,0))
if __name__ == "__main__":
try:
main()
except SystemExit:
pass
except:
traceback.print_exc()
pygame.quit()
input()
|