0
여기에서 아주 새로운 프로그래밍에 대해 일반적으로 다른 사람들에게 도움을 요청하기로 결정했습니다.Python 괴괴 망간 한 상호 작용
import sys,os
import pygame
black = (0, 0, 0)
white = (255, 255, 255)
green = (0, 255, 0)
red = (255, 0, 0)
blue = (0, 0, 255)
pygame.init()
# Set the width and height of the screen [width,height]
size=[700,500]
screen=pygame.display.set_mode(size)
pygame.display.set_caption("DN[A]")
#Loop until the user clicks the close button.
done=False
# Used to manage how fast the screen updates
clock=pygame.time.Clock()
FPS=60
#Loading images below.
n=1
z=1
maxint=10
minint=-maxint
# -------- Main Program Loop -----------
while done==False:
for event in pygame.event.get(): # User did something
if event.type == pygame.QUIT:
done=True
# above this, or they will be erased with this command.
screen.fill(black)
x,y=pygame.mouse.get_pos()
for i in range(size[1]):
screen.set_at((x,y),blue)
x+=1
y+=n
n+=z
if n==maxint or n==minint:
z=-z
pygame.display.flip()
clock.tick(FPS)
pygame.quit()
기본적으로 maxint가 10이면 반성을 얻습니다. 내가 목표로하는 것은 maxint가 5 일 때의 결과이다. 왜 그렇게하는지 누구나 알고있다.
또한 6 또는 다른 숫자 일 때도 낯선 사람이됩니다.
나중에 참조할만한 참고 사항 : 사용중인 모든 모듈 (예 :이 경우 Pygame)에 질문을 태그로 지정하는 것을 잊지 마십시오. – Torxed
감사합니다. – user2347832