matrix.py

Created by elodie-gamot

Created on October 21, 2021

460 Bytes

Effet Matrix dégoulinant


from kandinsky import *
from time import *
from random import *

green = color(180,255,180)
black=color(20,20,20)

def matric():
  fill_rect(0,0,320,222,black)
  trix=[[randint(0,320),randint(0,200)] for i in range(50)]
  t=monotonic()
  while True:
   if monotonic()-t>.15:
    t=monotonic()
    for i,v in enumerate(trix):
      fill_rect(v[0],v[1],2,3,green)
      v[1]+=randint(1,10)
      if v[1]>220: [v[0],v[1]]=[randint(0,320),0]