Total Complexity | 3 |
Total Lines | 23 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from pypen import * |
||
2 | |||
3 | |||
4 | def pseudo_random(seed: float): |
||
5 | return abs(sin(seed % 478562)*cos(seed % 3579)) |
||
6 | |||
7 | def update(): |
||
8 | clear_screen() |
||
9 | |||
10 | i = 0 |
||
11 | offset_y = TIME*170 |
||
12 | |||
13 | for x, y in grid(spacing=30): |
||
14 | seed = i+x*y |
||
15 | |||
16 | actual_y = (y + offset_y) % HEIGHT - 30 |
||
17 | percentage = (1-(actual_y/HEIGHT)**5) |
||
18 | color = (80, 130, 50, pseudo_random(seed)*255*percentage) |
||
19 | |||
20 | circle(x, actual_y, pseudo_random(seed)*14*percentage, color) |
||
21 | |||
22 | i += 1 |
||
23 |