-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (26 loc) · 837 Bytes
/
main.py
File metadata and controls
32 lines (26 loc) · 837 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
26
27
28
29
30
31
32
from ursina import *
from ursina.prefabs.first_person_controller import FirstPersonController
class Voxel(Button):
def __init__(self, position = (0,0,0)):
super().__init__(
parent = scene,
position = position,
model = "cube",
origin_y = 0.5,
texture = 'white_cube',
color = color.white,
highlight_color = color.lime
)
def input(self,key):
if self.hovered:
if key == 'left mouse down':
voxel = Voxel(position = self.position + mouse.normal)
if key == 'right mouse down':
destroy(self)
app = Ursina()
for z in range(20):
for x in range(20):
for y in range(2):
voxel = Voxel(position = (x,y,z))
player = FirstPersonController()
app.run()