-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
66 lines (45 loc) · 1.35 KB
/
app.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
from ursina.application import pause, resume
from ursina.ursinastuff import destroy
from game import app
from ursina import *
from game import hand
from game.entities.menu import Menu, Exit, PlayGame
#from game.__init__ import voxel
its_menuopen = False
menu = None
exit = None
play = None
def update():
global menu, its_menuopen,exit,play
if held_keys['escape'] and not its_menuopen:
mouse.visible = True
mouse.locked = False
window.exit_button.visible = True
pause()
menu = Menu()
exit = Exit()
play = PlayGame()
exit.on_click = application.quit
def restart():
mouse.visible = False
mouse.locked = True
window.exit_button.visible = False
destroy(menu)
destroy(exit)
destroy(play)
resume()
play.on_click = restart
print("Menu Abierto")
its_menuopen= True
elif held_keys['escape'] and its_menuopen:
print("Menu Cerrado")
its_menuopen= False
menu = None
exit = None
play = None
if held_keys['left mouse'] or held_keys['right mouse']:
hand.active()
else:
hand.passive()
if __name__ == "__main__":
app.run()