import pygame
from sys import exit #So "pygame.quit()" does not undo "pygame.init()"
#initiates pygame
pygame.init()
#variable for window size (width,height)
screen = pygame.display.set_mode((256,256))
#Name of game displayed on the window
pygame.display.set_caption("bill's Super Shooty World")
#Set maximum frame rate to keep framerate consistant
clock = pygame.time.Clock()
bg1_surface = pygame.image.load('Graphics/BG 1.png')
block_surface = pygame.image.load('Graphics/Block.png')
#Keep the code running forever instead of just for one frame, thus keeping the window open instead of it closing after one frame.
while True:
#allows us to actually quit the windows
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
exit() #So "pygame.quit()" does not undo "pygame.init()"
# draw all our elements
# update everything
#The order in which you call the images determind what layer they're on
screen.blit(bg1_surface,(0,0))
screen.blit(block_surface,(0,0))
pygame.display.update()
clock.tick(60) #Set maximum frame rate to keep framerate consistant