import sys, time def texttime(words): for c in words: sys.stdout.write(c) sys.stdout.flush() time.sleep(0.1) texttime("Hello World\n")
Random velocity
import sys, time from random import randrange def texttime(words): for c in words: sys.stdout.write(c) sys.stdout.flush() # if c == " ": if randrange(1, 5) == 3: time.sleep(0.1) text = """ import pygame, sys, random while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit() if event.type == pygame.KEYDOWN: if event.key == pygame.K_SPACE and game_active: bird_movement = 0 bird_movement -= 12 flap_sound.play() if event.key == pygame.K_SPACE and game_active == False: game_active = True pipe_list.clear() bird_rect.center = (100,512) #bird_movement = 0 score = 0 pygame.display.update() clock.tick(30) """ texttime(text)
Here is an example of the output.
Have fun.
Twitter: @pythonprogrammi - python_pygame