I am using python3 and pygame to make a program that will collect text input and button inputs from the user to generate a word document. I am using a variable based logic loop to determine which screen of text updates. I have watched videos on this tpoc and am very confused on what I am not doing here. below is a simplified version of my code. The program below program_intro checks for click location, generates the buttons, and changes the program1,program2, and program3 boolean to the next screen. I have verified clicking the button does change the Boolean values via print(program*). The Booleans update but the screen remains on the same initial screen everytime.
global program1
program1 = True
global program2
program2 = False
global program2
program3 = False
#program controls
run = True
#program
while run:
#game state
global program_state
program_state = 'program1'
for event in pygame.event.get():
print(event)
if event.type == pygame.QUIT:
pygame.quit()
quit()
if program_state == 'program1':
text1 = text_font.render('Client Name', False, 'Red')
program_intro()
screen.blit(text1,(50,100))
pygame.display.update()
if program_state == 'program2'
text2 = text_font.render('Your Mom's Name', False, 'Red')
program_intro()
screen.blit(text2,(50,100))
pygame.display.update()
if program_state == 'program3'
text3 = text_font.render('Your Mom's Mom's Name', False, 'Red')
program_intro()
screen.blit(text3,(50,100))
pygame.display.update()
if program_state == 'program4':
text4 = text_font.render('Client Name', False, 'Red')
screen.blit(text4,(50,200))
pygame.display.update()
if program_state == 'program5':
pass
if program_state == 'program6':
pass
if program_state == 'program7':
pass
if program_state == 'program8':
pass