마우스를 클릭했을 때 마우스 위치에 원을 그리고 싶지만 작동하지 않습니다. 인터넷을 통해 들려오는 것처럼 while 루프 안에 있지만 여전히 작동하지 않습니다. 누군가 제발 도와 줄 수 있어요. 감사.마우스 클릭시 동그라미가 그려지지 않습니다 (파이 게임)
pygame.draw.circle(screen, planet_color, (circ), planet_radius, 0)
항상 오류 로그를 확인하십시오 :
pygame.draw.circle(screen, planet_color, (circa), planet_radius, 0)
을 코딩 할 때
def run_game():
screen_height = 670
screen_width = 1270
pygame.init()
screen = pygame.display.set_mode((screen_width, screen_height))
screen.fill((10,10,30))
running = True
pygame.display.flip()
while running:
planet_color = (255,0,0)
planet_radius = 100
circ = pygame.mouse.get_pos()
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
elif event.type == pygame.MOUSEBUTTONDOWN:
pygame.draw.circle(screen, planet_color, (circa), planet_radius, 0)
elif event.type == pygame.KEYDOWN:
if event.key == pygame.K_q:
running = False
run_game()
방금 수정했지만 여전히 작동하지 않습니다. –