这是代码:
当我尝试使用Python启动器打开文件时,出现以下错误提示:
这是代码:
"""
Hello Bunny - Game1.py
By Finn Fallowfield
"""
# 1 - Import library
import pygame
from pygame.locals import *
# 2 - Initialize the game
pygame.init()
width, height = 640, 480
screen=pygame.display.set_mode((width, height))
# 3 - Load images
player = pygame.image.load("resources/images/dude.png")
# 4 - keep looping through
while 1:
# 5 - clear the screen before drawing it again
screen.fill(0)
# 6 - draw the screen elements
screen.blit(player, (100,100))
# 7 - update the screen
pygame.display.flip()
# 8 - loop through the events
for event in pygame.event.get():
# check if the event is the X button
if event.type==pygame.QUIT:
# if it is quit the game
pygame.quit()
exit(0)
当我尝试使用Python启动器打开文件时,出现以下错误提示:
File "/Users/finnfallowfield/Desktop/Code/Game1.py", line 15, in <module>
player = pygame.image.load("resources/images/dude.png")
pygame.error: Couldn't open resources/images/dude.png
顺便说一下,我正在运行一个移植的64位pygame版本。我在OS X Mountain Lion上使用Komodo Edit 8和Python 2.7.5。