for some reason, this code keeps looping when I run it.
for event in pygame.event.get():
if event.type == pygame.QUIT:
sys.exit()
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_ESCAPE:
sys.exit()
x = p_pos[0]
y = p_pos[1]
if event.key == pygame.K_LEFT:
x -= 30
if event.key == pygame.K_RIGHT:
x += 30
p_pos = [x,y]