Hardware Reference
In-Depth Information
drawWords(q[1],aPos[0], False)
drawWords(q[2],aPos[1], False)
drawWords(q[3],aPos[2], False)
drawWords(q[4],aPos[3], False)
pygame.display.update()
answer = q[1]
answerPos = aPos[0]
def drawWords(words,pos,inv) :
if inv :
text = font.render(words, True, altcText, ;
altcTextBack )
else :
text = font.render(words, True, cText, cTextBack )
textRect = text.get_rect()
if pos == 2 :
textRect.right = placeX[2]
elif pos == 3:
textRect.left = placeX[3]
else:
textRect.centerx = placeX[pos]
textRect.top = placeY[pos]
pygame.draw.rect(screen,cTextBack, textRect, 0)
screen.blit(text, textRect)
pygame.draw.rect(screen,cOutline, textRect, 2)
def correct() :
nextTime = 0
for flash in range(0,10) :
while time.time() < nextTime :
pass
if flash & 1:
drawWords(answer,answerPos, False)
else :
drawWords(answer,answerPos, True)
pygame.display.update()
nextTime = time.time() + 0.3
def terminate(): # close down the program
print (“Closing down please wait”)
pfio.deinit() # close the pfio
pygame.quit() # close pygame
continued
Search WWH ::




Custom Search