Pygame入門 図形(四角)を動かす

import pygame
import sys

SCREEN_SIZE = (400, 400)
WHITE = (255, 255, 255)
RED   = (255,   0,   0)
FPS = 1

def main():
    pygame.init()
    clock = pygame.time.Clock()
    screen = pygame.display.set_mode(SCREEN_SIZE)
    ball = pygame.Rect(100, 100, 10, 10)

    while True:
        screen.fill(WHITE)
        pygame.draw.rect(screen, RED, ball)
        ball.move_ip(10, 0)
        pygame.display.update()
        clock.tick(FPS)

        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                pygame.quit()
                sys.exit()

if __name__ == '__main__':
    main()