-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlauncher.py
209 lines (176 loc) · 4.33 KB
/
launcher.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
from ursina import *
import os
import sys
from ursina.shaders.lit_with_shadows_shader import lit_with_shadows_shader
lang = sys.argv[1]
if lang == 'en_US':
from assets.text.en_US import *
elif lang == 'zh_CN':
from assets.text.zh_CN import *
elif lang == 'zh_TW':
from assets.text.zh_TW import *
elif lang == 'en_UK':
from assets.text.en_UK import *
elif lang == 'ru_RU':
from assets.text.ru_RU import *
else:
from assets.text.en_US import *
app = Ursina(borderless=False,title=launcher_title)
camera.position = (0,0.5,0)
camera.fov = 150
Text.default_font = 'assets/fonts/unifont.otf'
menu_bgm1 = Audio('assets/sounds/bgm/menu1.mp3', loop=True, autoplay=True)
buttonclick = Audio('assets/sounds/gui/click.mp3', autoplay=False)
window.exit_button.visible = False
menu_bgm1.play()
tln = ''
def input(key):
global tln
if key == '1':
tln = '1.mclevel'
if key == '2':
tln = '2.mclevel'
if key == '3':
tln = '3.mclevel'
if key == '4':
tln = '4.mclevel'
if key == '5':
tln = '5.mclevel'
def play_game():
global tln
buttonclick.play()
print(tln)
os.system('python minecraft.py ' + lang + ' ' + tln)
bg_buttom = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_5.png',
position=(0,0,0),
rotation_y=90,
scale=(1,0.01,1)
)
bg_up = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_4.png',
position=(0,1,0),
rotation_y=90,
rotation_x=-180,
scale=(1,0.01,1)
)
bg_forward = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_0.png',
position=(0.5,0.5,0),
rotation_x=-90,
rotation_y=90,
scale=(1,0.01,1)
)
bg_back = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_2.png',
position=(-0.5,0.5,0),
rotation_x=-90,
rotation_y=90,
rotation_z=180,
scale=(1,0.01,1)
)
bg_left = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_3.png',
position=(0,0.5,0.5),
rotation_x=-90,
rotation_y=0,
rotation_z=0,
scale=(1,0.01,1)
)
bg_right = Entity(
parent=scene,
model='cube',
texture='assets/textures/gui/background/panorama_1.png',
position=(0,0.5,-0.5),
rotation_x=-90,
rotation_y=180,
rotation_z=0,
scale=(1,0.01,1)
)
'''background = Entity(
parent=scene,
model='cube',
position=(0,0,0),
scale=(1024,1,1024),
shader=lit_with_shadows_shader,
texture='assets/textures/block/grass_top.png',
texture_scale=(1024,1024),
collider='box',
color=color.green
)'''
title = Entity(
parent=camera.ui,
model='cube',
texture='assets/textures/gui/title.png',
origin=(0,-1.5),
scale=(0.9,0.2)
)
splashes = Text(
parent=camera.ui,
text=splashes_text,
origin=(-0.8,-3.5),
color=color.yellow,
scale=(1.5,1.5),
rotation_z=-20
)
about1 = Text(
parent=camera.ui,
text='Minecraft by Mojang Studio',
origin=(2.2,18),
scale=(1,1)
)
about2 = Text(
parent=camera.ui,
text='Minecraft Community Edition by Ekuta Studio',
origin=(1.13,19),
scale=(1,1)
)
about3 = Text(
parent=camera.ui,
text='Alpha 0.3.0',
origin=(-5.8,19),
scale=(1,1)
)
play_button = Button(
parent=camera.ui,
model='cube',
texture='assets/textures/gui/button1.png',
text=play_button_text,
color="#dddddd",
scale=(0.3,0.1),
origin=(0,0),
highlight_color=color.green,
on_click=play_game
)
play_multigame_button = Button(
parent=camera.ui,
model='cube',
texture='assets/textures/gui/button1.png',
text="MultiPlayer game",
color=color.gray,
scale=(0.3,0.1),
origin=(0,1.2),
highlight_color=color.gray,
# on_click=play_game
)
# pivot = Entity()
# DirectionalLight(parent=pivot,position=(0,128,0),shader=False)
# sky = Sky(texture='assets/textures/shader/sky.png')
select_level_pstext = Text(
parent=camera.ui,
text=select_level_pstext_text,
origin=(0,8.5)
)
def update():
camera.rotation_y += 5 * time.dt
app.run()