Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # ################### #
- # #
- # Matthias Wheelhouse #
- # Advent #
- # #
- # ################### #
- import pygame, sys
- from pygame.locals import *
- pygame. init()
- # set size and name
- size = [420, 250]
- screen = pygame.display.set_mode((size))
- pygame.display.set_caption("Advent")
- # screen refresh
- clock = pygame.time.Clock()
- ## setup of the main program loop and it's variables ##
- done = False
- black = ( 0, 0, 0)
- background = pygame.image.load('bg.bmp')
- # --- Main Program Loop --- #
- while done == False:
- for event in pygame.event.get(): # user did something
- if event.type == pygame.QUIT: # if user clicked close
- done = True # flag done to exit this loop
- # all game logic should go below this comment
- # all code to draw should go below this comment
- screen.fill(black)
- screen.blit(background(0, 0))
- # update screen
- pygame.display.flip()
- # limit to 20 frames per second
- clock.tick(20)
- # Close the window and quit
- pygame.quit ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement