Advertisement
mwheelhouse

'pygame.Surface' object is not callable?

Dec 30th, 2012
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.01 KB | None | 0 0
  1. # ################### #
  2. #                     #
  3. # Matthias Wheelhouse #
  4. #       Advent        #
  5. #                     #
  6. # ################### #
  7.  
  8. import pygame, sys
  9. from pygame.locals import *
  10. pygame. init()
  11.  
  12. # set size and name
  13. size = [420, 250]
  14. screen = pygame.display.set_mode((size))
  15. pygame.display.set_caption("Advent")
  16.  
  17. # screen refresh
  18. clock = pygame.time.Clock()
  19.  
  20. ## setup of the main program loop and it's variables ##
  21. done = False
  22. black = ( 0, 0, 0)
  23. background = pygame.image.load('bg.bmp')
  24. # --- Main Program Loop --- #
  25. while done == False:
  26.     for event in pygame.event.get(): # user did something
  27.         if event.type == pygame.QUIT: # if user clicked close
  28.             done = True # flag done to exit this loop
  29.  
  30.  
  31.     # all game logic should go below this comment
  32.  
  33.     # all code to draw should go below this comment
  34.     screen.fill(black)
  35.     screen.blit(background(0, 0))
  36.     # update screen
  37.     pygame.display.flip()
  38.  
  39.     # limit to 20 frames per second
  40.     clock.tick(20)
  41.  
  42. # Close the window and quit
  43. pygame.quit ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement