I wrote this code but it didn't work , I mean the window went unresponding :(.Please help!! Python_Army;) Is the problem my laptop or my laptop or is it the code and if you could improve my code please answer me as fast as possible!!
here is the code:
import pygame
pygame.init()
display_width = 800
display_height = 600
black = (0,0,0)
white = (255,255,255)
red = (255,0,0)
gameDisplay = pygame.display.set_mode((display_width,display_height))
background = pygame.image.load('C:/Users/H.S/Desktop/background.png')
player = pygame.image.load('C:/Users/H.S/Desktop/player.png')
file = pygame.image.load('C:/Users/Public/Pictures/Sample Pictures/Hydrangeas.jpg')
pygame.display.set_icon((file))
pygame.display.set_caption('a bit racey')
clock = pygame.time.Clock()
gameDisplay.blit(background, (0,0))
x = 300
y = 500
c = input()
if c == a:
x-=1
y = 500
pygame.display.flip()
pygame.display.update()
gameDisplay.blit(player, (x,y))
elif c == d:
x+=1
y = 500
pygame.display.update()
pygame.display.flip()
gameDisplay.blit(player, (x,y))
elif c == w:
y+=1
x = 300
pygame.display.flip()
pygame.display.update()
gameDisplay.blit(player, (x,y))
elif c == s:
y-=1
x = 300
pygame.display.flip()
pygame.display.update()
gameDisplay.blit(player, (x,y))
crashed = False
while not crashed:
for event in pygame.event.get():
if event.type == pygame.QUIT:
crashed = True