i was wondering if anyone had an example of code that shows basically the game asking a question and the user has to input 1,2,3,or 4. I am not sure how to accept user input on pygame and proceed to the next question. I have code that asks for the user to press any key to proceed, but i am specifically gearing towards a correct input. i have this function but am not sure how to change it select a number/string 1,2,3, or 4. I am also trying to actually have that input number random against the computer somehow using random.randit to see if the player will match the number and win. I am also doing this through pygame and using graphics and such. thanks in advance.
import pygame, random, sys
from pygame.locals import *
mainClock = pygame.time.Clock()
def waitForPlayerToSelect():
while True:
for event in pygame.event.get():
if event.type == QUIT:
leave()
if event.type == KEYDOWN:
if event.key == K_ESCAPE: # pressing escape quits
leave()
return