I cannot display the image that is in the same source folder as my project. Also it gives me squiggly lines under (x, y) and it tells me "Shadows name "x" & "y" from outer scope" It shows each one for the "x" and "y" so I just put & Lastly my quit() at the end tells me "PEP 8: blank line at the end of file"
Completely new to python and pygame
I am not sure what to try
import pygame
pygame.init()
display_Width = 400
display_Height = 400
gameDisplay = pygame.display.set_mode((display_Height, display_Width))
pygame.display.set_caption('Shonen Run Project')
black = (0, 0, 0)
white = (255, 255, 255)
clock = pygame.time.Clock()
crashed = False
heroImg = pygame.image.load('harper.png')
def hero(x, y):
gameDisplay.blit(heroImg, (x, y))
x = (display_Width * 0.45)
y = (display_Height * 0.8)
while not crashed:
for event in pygame.event.get():
if event.type == pygame.QUIT:
crashed = True
gameDisplay.fill(white)
hero(x,y)
pygame.display.update()
clock.tick(60)
pygame.quit()
quit()