fork download
  1.  
Success #stdin #stdout 0.07s 14068KB
stdin
import pygame
pygame.init()

screen = pygame.display.set_mode((500, 500))
clock = pygame.time.Clock()
x, y = 50, 250
speed = 5

running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False

    x += speed
    if x > 450 or x < 50:
        speed = -speed

    screen.fill((0, 0, 0))
    pygame.draw.circle(screen, (255, 0, 0), (x, y), 30)
    pygame.display.flip()
    clock.tick(60)

pygame.quit()
stdout
Standard output is empty