0
我們可以在幾行代碼中繪製很多東西嗎?我想盡快完成這項工作,但我做不到。在PyGame中繪製很多東西
這是代碼:
def village_pointlist_creator(village_number, timer=0):
global pointlist
pointlist = []
while (village_number + 1) != timer:
k = random.randrange(50, 551, 100)
p = random.randrange(50, 551, 100)
# we should check the points here.
pointlist.append((k, p))
timer += 1
return pointlist
def village_display(pointlist):
pygame.draw.circle(window, black, (pointlist[0][0], pointlist[0][1]), 25)
pygame.draw.circle(window, black, (pointlist[1][0], pointlist[1][1]), 25)
pygame.draw.circle(window, black, (pointlist[2][0], pointlist[2][1]), 25)
pygame.draw.circle(window, black, (pointlist[3][0], pointlist[3][1]), 25)
pygame.draw.circle(window, black, (pointlist[4][0], pointlist[4][1]), 25)
pygame.draw.circle(window, black, (pointlist[5][0], pointlist[5][1]), 25)
pygame.draw.circle(window, black, (pointlist[6][0], pointlist[6][1]), 25)
pygame.draw.circle(window, black, (pointlist[7][0], pointlist[7][1]), 25)
pygame.draw.circle(window, black, (pointlist[8][0], pointlist[8][1]), 25)
pygame.draw.circle(window, black, (pointlist[9][0], pointlist[9][1]), 25)
pygame.draw.circle(window, black, (pointlist[10][0], pointlist[10][1]), 25)
pygame.draw.circle(window, black, (pointlist[11][0], pointlist[11][1]), 25)
所以,我想第二部分短。