In Python, I have defined a subroutine that is meant to take a list of strings and display them, through PyGame, on seperate Y-axis values. The code is as follows:
def blittext(list): # expects the list from the displaytext() function
for i in list:
z = 490
text = ""
for letter in i:
#print("blitting")
text += letter
textFont = pygame.font.Font(os.path.join("InconsolataR.ttf"), 20)
textblit = textFont.render(text, True, (255,255,255))
display.blit(textblit, (400, z))
pygame.display.update()
z += 40
The line in question that is being skipped over is the last line:
z += 40
Which is supposed to add an increment of 40 after each line passes, but instead the function continues on as if the variable hadn't changed. I can't imagine this being an error of python, but rather a fundamental of nested states I've forgotten.