-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathminecraft.py
More file actions
25 lines (22 loc) · 747 Bytes
/
minecraft.py
File metadata and controls
25 lines (22 loc) · 747 Bytes
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
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
app = Ursina()
player = FirstPersonController()
Sky()
boxes = []
for i in range(20):
for j in range(20):
box = Button(color=color.white, model='cube', position=(j,0,i),
texture='grass.png', 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='cube', position=box.position + mouse.normal,
texture='grass.png', parent=scene, origin_y=0.5)
boxes.append(new)
if key == 'right mouse down':
boxes.remove(box)
destroy(box)
app.run()