forked from ZippyCodeYT/Zippy_Codes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminecraftClone.py
More file actions
66 lines (56 loc) · 1.28 KB
/
minecraftClone.py
File metadata and controls
66 lines (56 loc) · 1.28 KB
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 import *
from ursina.prefabs.first_person_controller \
import FirstPersonController
app = Ursina()
Sky()
player = FirstPersonController()
window.fullscreen = True
arm = Entity(
parent=camera.ui,
model='cube',
color=color.blue,
position=(0.75, -0.6),
rotation= (150, -10,6),
scale = (0.2,0.2,1.5)
)
def update():
if held_keys['left mouse']:
arm.position = (0.6, -0.5)
elif held_keys['right mouse']:
arm.position = (0.6, -0.5)
else:
arm.position = (0.75, -0.6)
boxes = []
for n in range(15):
for k in range(15):
box = Button(
position=(k, 0, n),
color=color.orange,
highlight_color=color.lime,
model='cube',
texture=
load_texture('assets\wood'),
origin_y=0.5,
parent=scene
)
boxes.append(box)
def input(key):
for box in boxes:
if box.hovered:
if key == 'left mouse down':
newBox = Button(
position=
box.position + mouse.normal,
color=color.orange,
highlight_color=color.lime,
model='cube',
texture=
load_texture('assets\wood'),
origin_y=0.5,
parent=scene
)
boxes.append(newBox)
if key == 'right mouse down':
boxes.remove(box)
destroy(box)
app.run()