나는 파이 게임을 macports를 통해 설치합니다. 나는 Macports를 사용하여 파이 게임 설치
sudo port install py26-game
같은 파이 게임 코드를 쓴 같은
instructions을, 다음 :
#image settings
bif = "bg.jpg"
mif = "ball.jpg"
#Basic Settings for pygame
import pygame, sys
from pygame.locals import *
pygame.init()
#Create a screen and load the images
screen = pygame.display.set_mode((640,360),0,32) #size,flag,bit
background = pygame.image.load(bif).convert()
mouse_c = pygame.image.load(mif).convert_alpha()
while True:
for event in pygame.event.get():
if event.type == QUIT:
pygame.quit()
sys.exit()
screen.blit(background,(0,0))
x,y = pygame.mouse.get_pos()
x -= mouse_c.get_width()/2
y -= mouse_c.get_height()/2
screen.blit(mouse_c,(x,y))
pygame.display.update()
나는 게임을 만들 숭고한 텍스트 2를 사용하고,하지만이 오류가 있습니다
Traceback (most recent call last):
File "PygameTutorial.py", line 6, in <module>
import pygame, sys
ImportError: No module named pygame
을
내 단말기에서 같은 오류가 발생하여 동일한 오류가 발생했습니다.
>>> import pygame
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pygame
어떻게 해결할 수 있습니까?
아니요. '파이 게임'으로 설치됩니다. – MattDMo