1+ # Efecto Matrix
2+ # @autor: Magno Efren
3+ # Youtube: https://www.youtube.com/c/MagnoEfren
14
25from tkinter import Frame , Tk , Canvas
36from random import choice
@@ -9,7 +12,6 @@ def __init__(self, master):
912 self .canvas = Canvas (master , bg = 'black' )
1013 self .canvas .place (relx = 0 , rely = 0 , relwidth = 1 , relheight = 1 )
1114
12-
1315 self .velocidad = [i for i in range (0 ,30 ,5 )]
1416 self .pos = [i for i in range (- 200 ,200 ,20 )]
1517 self .letters = []
@@ -27,7 +29,6 @@ def __init__(self, master):
2729 "j" , "t" , "4" , "4" , "4" , "П" , "Ц" ,
2830 ]
2931
30-
3132 self .draw ()
3233 self .update ()
3334
@@ -39,15 +40,13 @@ def draw(self):
3940 fill = 'green2' , font = ('Arial' , 14 ))
4041 self .letters .append (self .obj )
4142
42-
4343 def update (self ):
4444 for letter in self .letters :
4545 v = choice (self .velocidad )
4646 self .green += 5
4747 color = '#{:02x}{:02x}{:02x}' .format (0 ,self .green ,0 )
4848 self .canvas .itemconfig (letter , fill = color )
4949 self .canvas .move (letter , 0 , v )
50-
5150 y = self .canvas .coords (self .obj )
5251
5352 if self .green >= 250 :
@@ -61,14 +60,10 @@ def update(self):
6160
6261 self .canvas .after (80 , self .update )
6362
64-
65-
66-
67-
6863if __name__ == '__main__' :
6964 root = Tk ()
7065 root .title ('Matrix Animation' )
7166 root .config (bg = 'black' )
7267 root .attributes ('-fullscreen' , True )
7368 app = Matrix (root )
74- app .mainloop ()
69+ app .mainloop ()
0 commit comments