Do I have to use pygame.display.flip() or pygame.display.update()?
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_d:
x += 1
surface.fill((0,0,0))
pygame.draw.rect(surface, color, pygame.Rect(x, y, 60, 60))
pygame.display.update()