-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
236 lines (232 loc) · 11.4 KB
/
main.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
'''
__,,aadd888888888baa,_
,ad88888888888888888888888a,
,d88888888888888888888888888888a,
,d888888888888888888888888888888888b,
,d888888888888888888888888888888888888b
d88888888888888888888888888888888888888b
8888888888888888888888888888888888888888,
,8888888888888888888888888888888888888888b
d88888888888888888888888888888888888888888,
888888888888888888888888888888P'`888888888b
,88888888888888888888P"88P"Y888b Y888888888,
,d888888888888888888P" d8P' "88P "Y8888888b
d88888888888888888P" Y" ,8P 88888888
;88888888888888888P' '"""" Y" '"""" 8888888P
I88888888888888888' ,aaa, /,aaa, 8888888'
I8888888888\888888 `b8d' | `b8d' 888888P
`Y8888888888\88888 ( ,888888'
`Y8888888888)8888 (___) I88888'
"888888888|8888, ,8888P'
"8888888|8888I ,ad8a8ba, ,8888"
"88888|88888, "Y888P" ,888P'
`8888|8888`Ya, ,ad888P_
8888|8888 `"Yba,,,,,,d88888888888baaa,,_
I888|8888 `""Y88888888P"' `""""Y8baa,,_
8888'8888, ,8888888P `"""Y8baa,,_
,888P Y888b I8888888' `"""8baa,_
,8Y8P' `Y888, 88888888 `""YYaa,_
"',P' `"Y8, I8888888, `""Yba_
,d' `" Y888888b `"b
,d' Y888888b, _______ 8
,8' Y8888888ba,,__,aad88b"""YYY8bba,,_ 8
dP "88888888888888888888a, `"""Yba, 8
8I `888888888888888888888, "b 8
8b `88888888888888888888b 8 ,P
I8, `Y8888888888888888888 8 d'
`88, `Y88888888888888888P 8 8
8`Yb `Y888888888888888P' 8 ,P
8 `Yb Y, `8888888888888P" 8 d'
8 `Yb `8, `Y88888888888 8 8
8 `Yb `8, `Y8888888888 8 ,P
8 `Yb, `8, `8888888888 8 d'
8 "Yb, `Yb, 8888888888 8 ,P
8 "8b, "Yb, ,8888888888 8 ,d'
8 8 "Ya, `"8, d8888888888, 8 d'
8 8 `"Ya, "Ya_ ,88888888P"'Yb, 8 ,P
8 8 `"Ya,_ `"8a, ,d8888P"' ,Y8, ,8 d'
8 8 `"Yb,_ "Y888P"' ,ad88888b, ,8' ,P
8 "ba,_ `"Ybad" ,ad88888888888baaaadP" ,aP'
8, `"Yba,_ ,P' ,ad8888888888P"""""' ,dP'
`8b, `""Ya, ,da8888888888888888bbbaaaaaaadP"'
"Y8a, `"Ya,,d88888888888888888888888888b
`"Ya,._ `Y888888888888888888888888888888,
`""Yba,_ ,d8888888888888888888888888888888b
`""YYaa,,,d8888888888888888888888888888888888,
`"d8888888888888888888888888888888888888b
,d8888888888888888888888888888888888888888,
a8888888888888888888888888888888888888888888b
,d8888888888888888888888PP"":::::::::::""Y888888,
,d8888888888888888PP""::::::::::::::::::::::888888b,
d888888888888P"":::::::::::::::::::::::::::::Y8888888b
d888888888P:;P:::::::::::::::::::::::::::::::::88888888b
,88888888P"::;P::::::::::::::::::::::::::::::::::888888888,
,d8888888P:::::d:::::::::::::::::::::::::::::::::::888888888b
a8888888P:::::::8:::::::::::::::Normand:::::::::::::I888888888
,d8888888"::::::::8:::::::::::::::Veilleux::::::::::::I888888888
,d8888888P:::::::::8;::::::::::::::::::::::::::::::::::I888888888
,d88888888::::::::::Yb;:::::::::::::::::::::::::::::::::I88888888P
,d888888888:::::::::::Yb:::::::::::::::::::::::::::::::::I88888888'
d8888888888;:::::::::::Yb::::::::::::::::::::::::::::::::I8888888'
,88888888888b::::::::::::"8;::::::::::::::::::::::::::::::8888888P
d888888888888b:::::::::::::"Ya;::::::::::;;aa;::::::::::::888888P'
88888888888888b;:::::::::::::`YbbaaaadddPP"":::::::::::::;88888"
8888888888888888b;:::a;;;::;ad"8:::::::::::::::::::::::::d88P"
88888888888888888Y;::::""""":::8:::::::::::::::::::::::::8"
Y88888888888888888Y;:::::::::::8:::::::::::::::::::::::::8
`888888888888888888b:::::::::::8:::::::::::::::::::::::::8
Y888888888888888888:::::::::::8::::::::::::::::::::::::;P
`"Y888888888888888:::::::::::8::::::::::::::::::::::::d'
"Y8888P"Y888888:::::::::::8::::::::::::::::::::::::8
`"' `"' 8:::::::::::8::::::::::::::::::::::::8
8:::::::::::8::::::::::::::::::::::::8
8:::::::::::8;::::::::::::::::::::::;P
Y;::::::::::Ib::::::::::::::::::::::d'
`b:::::::::::8::::::::::::::::::::::8
8:::::::::::8:::::::::::::::::::::;P
Y;::::::::::8:::::::::::::::::::::d'
`b::::::::::Y;::::::::::::::::::::8
`b::::::::::b:::::::::::::::::::;P
Y;:::::::::8:::::::::::::::::::d'
`b:::::::::8:::::::::::::::::::8
Y;::::::::Y;:::::::::::::::::;P
`b:::::::::b::::::::::::::::;d'
Y;::::::::8:::::::::::::::;d'
`b::::::::8:::::::::::::::d'
Y;:::::::8::::::::::::::;P
`b:::::::8::::::::::::::d'
8:::::::8:::::::::::::;P
8:::::::8:::::::::::::d'
8::::::;8:::::::::::::8
8::::::dP::::::::::::;P
8:::::;P:::::::::::::d'
,P:::::d::::::::::::::8
d:::::;P::::::::::::::8
,P:::::d:::::::::::::::8
d:::::;P:::::::::::::::8
d::::::d::::::::::::::::8
d:::::::8::::::::::::::::Y,
,P::::::;P:::::::::::::::::b
,P:::::::d::::::::::::::::::8
,d::::::::8::::::::::::::::::8
,d::::::::;P::::::::::::::::::8
d:::::::::d:::::::::::::::::::8
8:::::::::8:::::::::::::::::::8
,P:::::::::8:::::::::::::::::::8
d::::::::::8:::::::::::::::::::8
8::::::::::8:::::::::::::::::::8
,P::::::::::8:::::::::::::::::::8
d:::::::::::8:::::::::::::::::::8
8:::::::::::8:::::::::::::::::::8
8:::::::::::8:::::::::::::::::::8
8:::::::::::8::::::::::::::::::;P
8:::::::::::8::::::::::::::::::d'
8:::::::::::8::::::::::::::::::8
8:::::::::::Y;:::::::::::::::::8
8::::::::::::b:::::::::::::::::8
8::::::::::::8;:::::::::::::::;P
8::::::::::::8I:::::::::::::::d'
8::::::::::::Yb;::::::::::::::8
8::::::::::::8"b::::::::::::::8
8::::::::::::8 8;::::::::::::;P
8:::::::::::;P `b::::::::::::d'
Y;::::::::::d' Y;:::::::::::8
`b::::::::::8 `b:::::::::::8
8::::::::::8 8:::::::::::8
8:::::::::;P 8:::::::::::8
8:::::::::d' 8::::::::::;P
Y;::::::::8 8::::::::::d'
`b::::::::8 8::::::::::8
8:::::::;P 8::::::::::8
8:::::::8' 8:::::::::;P
8:::::::8 8:::::::::d'
8:::::::8 8:::::::::8
8:::::::8 8:::::::::8
8:;;::::8 8:::::::::8
,88888b;:8 8:::::::::8
,d8888888b8 8:::::::::8
,d8888888888 ,d8;;:::::::Y,
d88888888888 ,d888888b;:::::b
,888888888888 ,d88888888b;::::8
d888888888888 d8888888888b::::8
Y888888888888 888888888888;:::8
`888888888888 888888888888b:::8
8888888:8888 8888888888888:::8
8888"ZZZ:888 Y888888888888:::Y,
888' ZZZ:888 `888P" `Y8888::::b
88P ZZZ:888 888' 8888::::8
88' ZZZ:888 Y88 8888;:::8
88 ZZZ:888, `88 Y888b:::8
88 ZZZ:888b 88 `8888:::8
"" ZZZ:8888, "" 8888;::Y,
`ZZZ:8888b, 8888b;::b,
"ZZZ:8888 Y888888888b,_
`"""""" "Y88888888888b,
`"Y8888888888
'''
def main():
from codes import init as base
from codes import startscreen as ss
from codes import popup
import pygame as pg
import pygame.locals as pgl
import time
#intialize objects
main=base.inital()
main.InitializeWindow()
mainwindow=main.screen
start_screen=ss.StartScreen()
start_screen.LoadTitle(main)
#easter_egg_quit_button=button.button(10,10,100,100)
is_start_screen=1
is_game_screen=0
windowManger=popup.PopupWindow()
def Hello():
return 0
clock=pg.time.Clock()
while 1:
clock.tick(60)
#print("4")
for event in pg.event.get():
if event.type == pgl.QUIT:
main.OnQuit()
if event.type==pgl.MOUSEBUTTONDOWN:
mousepos=pg.mouse.get_pos()
if is_start_screen==2:
button_result=start_screen.OnPress(mousepos,Hello,main.OnQuit)
print(button_result)
if button_result[0]!=None:
is_start_screen=button_result[0]
is_game_screen=button_result[0]+1
#easter_egg_quit_button.onclick(main.onquit(),mousepos)
#print("5")
if is_start_screen==1:
#show background if it's there
start_screen.ShowBackground(mainwindow)
start_screen.ShowStartExitButtonText(mainwindow,main)
start_screen.StartExitButton(main)
#show title text
start_screen.ShowTitle(mainwindow,main)
start_screen.PlayMusic("./res/bgm_start.m4a")
music_player_ss=start_screen.musicplayer
is_start_screen=2
elif is_game_screen==1:
music_player_ss.Stop()
main.InitializeWindow()
is_game_screen=2
#print("3")
elif is_game_screen==2:
#print("7")
pass
#Update display
pg.display.update()
#print("6")
if __name__=="__main__":
main()
'''
Something to say:
For SA participators, you had proved you really likes the project, you have great contributes to this project, so thanks for your contributing.
Especially Lambert, thanks for your passion in this project, also Regina, for providing emotion supports.
Thanks all the developers of open source projects these codes used, without your efforts, this could never be achieved.
--From the repo owner, github @sfever
'''