python - Typing effect in pygame buggy -


def story(text,img): font = pygame.font.sysfont("verdana", 17) max = int(len(text)) #image mr = menu.menusprite(chosen=img) screenstr = "" storyrun = true y=0 tl = [] x in text:     tl.append(x) while y<max:     screenstr = screenstr+tl[y]     renderstr = font.render(screenstr, true, (255,0,0))     vars.screen.blit(mr.image,(0,0))     vars.screen.blit(renderstr,(50 ,320))     y+=1     time.sleep(0.5)     pygame.display.flip() 

so code got far, function executed given string , image. stop working after time, meaning text won't type further rest of script gonna executed until end (found out testing printing random text)


Comments

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -