Advertisement
furas

Pygame - Instructions - without animation

Jan 9th, 2016
278
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def Instructions():
  2.  
  3.     # declare only once
  4.     paragraph = """Your are the last surviving rhino. Your horn
  5.        is worth millions! Right now you are trapped in a zoo and
  6.        waiting to be slaughtered for your horn. But you can't give
  7.        up! Escape from the tribesmen and zoo security so you can
  8.        enjoy your life as a free being once again"""
  9.  
  10.     # load only once
  11.     image = pygame.image.load("background0.jpg").convert()
  12.  
  13.     # create only once
  14.     InstructionFont = pygame.font.SysFont("elephant",15)
  15.  
  16.     # get only once
  17.     TextSurf, TextRect = text_objects(paragraph, InstructionFont)
  18.  
  19.     # set only once
  20.     #TextRect.center = ((screen_width/2),(screen_height/2))
  21.     TextRect.center = screen.center
  22.  
  23.     # create button only once
  24.     button = Buttons("BACK",100,500,120,50,TURQUOISE,DARK_TURQUOISE,"back")
  25.  
  26.  
  27.  
  28.     # blit only once
  29.     screen.blit(image, (0,0))
  30.  
  31.     # blit only once
  32.     screen.blit(TextSurf, TextRect)
  33.  
  34.     # draw only once
  35.     button.draw()
  36.  
  37.     # update only once
  38.     pygame.display.update()
  39.  
  40.     intro = True
  41.  
  42.     # repeat thousands times in one second.
  43.     while intro:
  44.  
  45.         # check events 15 times per second (15 FPS)
  46.         for event in pygame.event.get():
  47.             if event.type == pygame.QUIT:
  48.                 pygame.quit()
  49.                 quit()
  50.  
  51.         clock.tick(15) # <- slow down to 15 FPS
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement