-
카테고리
-
세부 분야
게임 프로그래밍
-
해결 여부
미해결
import pygame 실행이 안 돼요
21.07.23 15:03 작성 조회수 1.71k
0
pip install game 안 돼서 다른 분이 알려주신대로 py -m pip install pymongo --user 쳐서 처음 터미널 부분은 넘기고 그 다음에 import pygame 까지 나도코딩님이랑 똑같이 입력하고 실행했는데 터미널창에 아무것도 뜨지 않아요. 그냥 그대로 계속 따라가서 8분 5초에 있는 거까지 다 입력하고 실행했는데 창이 안 떠서 질문드립니다. 도와주세요 ㅠㅠ
답변을 작성해보세요.
0
2010david
2021.08.24
import pygame
만 하면 아무것도 안 뜨는게 맞습니다.
pip install game
이 아니라 pip install pygame
아닌가요
import pygame
pygame.init()
screen = pygame.display.set_mode((600, 400))
pygame.display.set_caption("Test Project")
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.fill((0, 0, 0))
screen.blit(pygame.font.Font(None, 30).render("Test", True, (255, 255, 255)), (100, 200))
pygame.display.update()
이 코드를 실행하고 흰색 Test 글자와 검은 배경이 뜨면 됩니다.
이렇게 뜨면 됩니다
답변 1