I have a window that pops up in Pygame with a green box but, despite using the K_RIGHT command it won't move right. When I press the right key it gives me no feedback suggesting I hit the right key. The box does not move right, my terminal is giving me no messages, and there is no debug message. It simply does nothing. any information on what I've done incorrectly would be highly appreciated. [code for context]
import pygame
pygame.init()
width=1800
height=900
red=(255,0,0)
green=(0,255,0)
blue=(0,0,255)
white=(0,0,0)
black=(255,255,255)
x=200
y=150
running = True
def main():
global running, screen, x, y
screen = pygame.display.set_mode((width,height))
while running:
pygame.draw.rect(screen, green, ( 900, 300, x, y))
for event in pygame.event.get():
if event.type==pygame.QUIT:
running = False
pygame.quit()
quit()
if event.type==pygame.KEYDOWN:
if event.type==pygame.K_RIGHT:
x+=20
pygame.display.update()
main()