-
Notifications
You must be signed in to change notification settings - Fork 0
/
Something.py
100 lines (88 loc) · 2.82 KB
/
Something.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
from __future__ import division
import sys
from pyfiglet import Figlet
from asciimatics.effects import Scroll, Mirage, Wipe, Cycle, Matrix, \
BannerText, Stars, Print
from asciimatics.particles import DropScreen
from asciimatics.renderers import FigletText, SpeechBubble, Rainbow, Fire
from asciimatics.scene import Scene
from asciimatics.screen import Screen
from asciimatics.exceptions import ResizeScreenError
def _credits(screen):
scenes = []
text = Figlet(font="banner", width=200).renderText("pndaboi!")
width = max([len(x) for x in text.split("\n")])
effects = [
Print(screen,
Fire(screen.height, 80, text, 0.4, 40, screen.colours),
0,
speed=1,
transparent=False),
Print(screen,
FigletText("PndaBoi!", "banner"),
screen.height - 9, x=(screen.width - width) // 2 + 1,
colour=Screen.COLOUR_BLACK,
bg=Screen.COLOUR_BLACK,
speed=1),
Print(screen,
FigletText("PndaBoi!", "banner"),
screen.height - 9,
colour=Screen.COLOUR_WHITE,
bg=Screen.COLOUR_WHITE,
speed=1),
]
scenes.append(Scene(effects, 100))
effects = [
Matrix(screen, stop_frame=200),
Mirage(
screen,
FigletText("PndaBoi!"),
screen.height // 2 - 3,
Screen.COLOUR_GREEN,
start_frame=100,
stop_frame=200),
Wipe(screen, start_frame=150),
Cycle(
screen,
FigletText("PndaBoi!"),
screen.height // 2 - 3,
start_frame=200)
]
scenes.append(Scene(effects, 250, clear=False))
effects = [
BannerText(
screen,
Rainbow(screen, FigletText(
"Always Making Amazing Code...", font='slant')),
screen.height // 2 - 3,
Screen.COLOUR_GREEN)
]
scenes.append(Scene(effects))
effects = [
Cycle(
screen,
FigletText("That's It!", font='big'),
screen.height // 2 - 8,
stop_frame=100),
Cycle(
screen,
FigletText("Byeeee!", font='big'),
screen.height // 2 + 3,
stop_frame=100),
Stars(screen, (screen.width + screen.height) // 2, stop_frame=100),
DropScreen(screen, 100, start_frame=100)
]
scenes.append(Scene(effects, 200))
effects = [
Print(screen,
SpeechBubble("Press 'X' to exit."), screen.height // 2 - 1, attr=Screen.A_BOLD)
]
scenes.append(Scene(effects, -1))
screen.play(scenes, stop_on_resize=True)
if __name__ == "__main__":
while True:
try:
Screen.wrapper(_credits)
sys.exit(0)
except ResizeScreenError:
pass