Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- import pygame
- pygame.init()
- screenWidth = 800
- screenHeight = 600
- white = (255, 255, 255)
- gameDisplay = pygame.display.set_mode([screenWidth, screenHeight])
- pygame.display.set_caption("2D Game")
- gameExit = False
- clock = pygame.time.Clock()
- with open("/home/richard/Desktop/ISCP/ProjectEen.txt", "r") as f:
- imageLocation = f.readlines()
- for image in imageLocation:
- level1Images = pygame.image.load("/home/richard/Desktop/ISCP/" + image)
- while not gameExit:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- gameExit = True
- if event.type == pygame.KEYDOWN:
- if event.key == pygame.K_LEFT:
- print(clock.get_fps())
- gameDisplay.fill(white)
- pygame.display.update()
- clock.tick(60)
- pygame.quit()
- quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement