-
Notifications
You must be signed in to change notification settings - Fork 0
/
terminal_animation.py
54 lines (41 loc) · 1.29 KB
/
terminal_animation.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import time
import os
import playsound
import footTap
import footTapAndHeadBup
import faceMimeing
import wreckingball
import hammerSkeletonSinging
import lyrics
playsound.playsound('Miley_Cyrus_Wrecking_Ball.mp3', False)
startTime = time.time()
previous = lyrics.frames[str(0.0)]
def printLyricLine(time):
global previous
try:
previous = lyrics.frames[str(time)]
print(lyrics.frames[str(time)])
except:
print(previous)
def animate(frames, duration, cycles):
"""Iterate through the frames, printing then clearing each one to create an animation."""
count = 0
while count < cycles:
for frame in frames:
print(frame)
printLyricLine(round(time.time() - startTime))
time.sleep(duration)
print(os.system('clear'))
count = count + 1
time.sleep(8.5)
animate(faceMimeing.frames, 0.3, 16)
animate(wreckingball.frames, 0.15, 5)
animate([wreckingball.frames[22]], 0.3, 7)
animate(hammerSkeletonSinging.frames, 0.5, 30 )
animate(wreckingball.frames, 0.15, 10)
animate(hammerSkeletonSinging.frames, 0.5, 31 )
animate(faceMimeing.frames, 0.3, 5)
animate(wreckingball.frames, 0.15, 13)
animate([wreckingball.frames[22]], 0.3, 100)
#animate(footTap.frames, 0.3, 4)
#animate(footTapAndHeadBup.frames, 0.3, 4)