Skip to content

Commit

Permalink
extend readme and add escape option
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrincoveanu committed Mar 2, 2022
1 parent 6855008 commit bf4a17f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# matrix
Matrix screen saver.
Full HD Matrix screen saver. Quit by pressing escape.
```
python main.py
```
![Preview](preview.png)
5 changes: 4 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file added preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bf4a17f

Please sign in to comment.