im trying to understand the basics of pygame by moving a rectangle using the d-pad on my keyboard but the rectangle isnt moving its staying in its initial position
import pygame
import sys
x1=0
y1=0
x2=100
y2=100
pygame.init()
screen=pygame.display.set_mode((288,512))
clock=pygame.time.Clock()
x = pygame.draw.rect(screen, (0, 255, 0), (0, 0, x2, y2))
while True:
for event in pygame.event.get():
if event.type==pygame.QUIT:
pygame.quit()
sys.exit()
if event.type==pygame.KEYDOWN:
if event.key==pygame.K_DOWN:
y1-=100
pygame.display.update()
clock.tick(120)