Advertisement
Guest User

Untitled

a guest
May 25th, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. import sys
  2. import pygame
  3.  
  4. pygame.init()
  5.  
  6. screenWidth = 800
  7. screenHeight = 600
  8.  
  9. white = (255, 255, 255)
  10.  
  11. gameDisplay = pygame.display.set_mode([screenWidth, screenHeight])
  12. pygame.display.set_caption("2D Game")
  13.  
  14. gameExit = False
  15.  
  16. clock = pygame.time.Clock()
  17.  
  18. with open("/home/richard/Desktop/ISCP/ProjectEen.txt", "r") as f:
  19. imageLocation = f.readlines()
  20.  
  21. for image in imageLocation:
  22. level1Images = pygame.image.load("/home/richard/Desktop/ISCP/" + image)
  23.  
  24. while not gameExit:
  25. for event in pygame.event.get():
  26. if event.type == pygame.QUIT:
  27. gameExit = True
  28. if event.type == pygame.KEYDOWN:
  29. if event.key == pygame.K_LEFT:
  30. print(clock.get_fps())
  31.  
  32. gameDisplay.fill(white)
  33.  
  34. pygame.display.update()
  35. clock.tick(60)
  36.  
  37. pygame.quit()
  38. quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement