diff --git a/README.md b/README.md index 656798a..9c00d38 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,6 @@ # matrix -Matrix screen saver. +Full HD Matrix screen saver. Quit by pressing escape. +``` +python main.py +``` +![Preview](preview.png) diff --git a/main.py b/main.py index 513acdb..7ad1a82 100644 --- a/main.py +++ b/main.py @@ -19,12 +19,15 @@ second_font = pygame.font.SysFont(None, SECOND_FONT_SIZE) clock = pygame.time.Clock() -columns = [0 for _ in range(COLS_NUM)] +columns = [0] * COLS_NUM while True: clock.tick(FPS) for event in pygame.event.get(): if event.type == pygame.QUIT: quit() + if event.type == pygame.KEYDOWN: + if event.key == pygame.K_ESCAPE: + quit() for i, column in enumerate(columns): c = (0, 120 + random.randint(0, 120), 0) if random.random() < 0.01: diff --git a/preview.png b/preview.png new file mode 100644 index 0000000..9ce6a71 Binary files /dev/null and b/preview.png differ