As far as i know this is all i should have to do to display and image on the screen but it doesn't. I know i must be missing something fairly obvious here but i can't see what i have missed out that is not letting my image appear on screen.
main.py
import pygame
from loading import *
from settings import *
class game():
def __init__(self):
self.gameRunning = True
self.screen = pygame.display.set_mode((screen_width, screen_height))
self.clock = pygame.time.Clock()
self.Background_images = load_images()
def gameLoop(self):
self.clock.tick(fps)
self.event()
self.update()
def event(self):
for event in pygame.event.get():
if event.type == pygame.QUIT:
self.gameRunning = False
def update(self):
self.screen.blit(self.Background_images["layer1"], (0,0))
pygame.display.update()
playGame = game()
while playGame.gameRunning == True:
playGame.gameLoop()
loading.py
import pygame
from settings import *
def load_images():
Parallax_images = {}
Parallax_images["layer1"] = pygame.image.load("PARALLAX\layer1.png")
Parallax_images["layer2"] = pygame.image.load("PARALLAX\layer2.png")
Parallax_images["layer3"] = pygame.image.load("PARALLAX\layer3.png")
Parallax_images["layer4"] = pygame.image.load("PARALLAX\layer4.png")
Parallax_images["layer5"] = pygame.image.load("PARALLAX\layer5.png")
Parallax_images["layer6"] = pygame.image.load("PARALLAX\layer6.png")
Parallax_images["layer7"] = pygame.image.load("PARALLAX\layer7.png")
Parallax_images["layer8"] = pygame.image.load("PARALLAX\layer8.png")
return Parallax_images