-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathMinecraftBallEdition.py
More file actions
57 lines (50 loc) · 1.26 KB
/
MinecraftBallEdition.py
File metadata and controls
57 lines (50 loc) · 1.26 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
from ursina import *
from ursina.prefabs.\
first_person_controller \
import FirstPersonController
app = Ursina()
Sky()
player = FirstPersonController()
from ursina.shaders \
import basic_lighting_shader
boxes = []
for n in range(12):
for k in range(12):
box = Button(
color=color.white,
model='sphere',
position=(k,0,n),
texture='grass',
shader=basic_lighting_shader,
parent=scene,
origin_y=0.5
)
boxes.append(box)
def input(key):
for box in boxes:
if box.hovered:
if key =='left mouse down':
new = Button(
color=color.white,
model='sphere',
position=box.position+
mouse.normal,
texture='grass',
shader=basic_lighting_shader,
parent=scene,
origin_y=0.5
)
boxes.append(new)
if key == 'right mouse down':
boxes.remove(box)
destroy(box)
sword = Entity(model='assets\\blade', texture='assets\sword', rotation=(30,-40),
position=(0.35,-0.6), parent=camera.ui, scale=(0.2,0.15))
def update():
if held_keys['left mouse']:
sword.position = (0.45,-0.5)
elif held_keys['right mouse']:
sword.position = (0.45,-0.5)
else:
sword.position = (0.5,-0.6)
app.run()