我想知道是否有人可以帮助我使用 pygame(Python)。我不断从我的代码中收到错误:
bif ="bg.jpg"
mif = "mouse.png"
import pygame
import sys
from pygame.locals import *
pygame.init()
screen=pygame.display.set_mode((682,415),0,32)
backround= pygame.image.load(bif).convert()
mouse_c=pygame.image.load(mif).convert()
x, y =0,0
movex, movey =0,0
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
if event.tpye == KEYDOWN:
if event.key==K_LEFT:
movex =-1
elif event.key==K_RIGHT:
movex=+1
elif event.key ==K_UP:
movey=-1
elif event.key==K_DOWN:
movey=+1
我得到的错误是:
Traceback (most recent call last):
File "C:\Documents and Settings\Aidan\Desktop\Mygame.py", line 15, in <module>
screen=pygame.display.set_mode((682,415),0,32)
pygame.error: No available video device`
我有一台在 Windows XP 上运行的 Sony Vaio VGN-T1XP。