You shouldnt have two main game loops like that. Here is an example using buttons between states. Notice there is only one while loop in the entire code regardless of the number of states. Classes are a fundamental part of python. I would learn that before trying to program games to be honest.
You are not using the button's event check correctly. It needs to be within the main loop's event check.
from this:
You are not using the button's event check correctly. It needs to be within the main loop's event check.
from this:
for event in pygame.event.get(): if event.type == pygame.QUIT: done = True studentButton.getEvent() teacherButton.getEvent()to this:
for event in pygame.event.get(): if event.type == pygame.QUIT: done = True studentButton.getEvent() teacherButton.getEvent()
Recommended Tutorials: