from ursina import * class Voxel(Button): def __init__(self, position=(0,0,0)): super().__init__( model='cube', color=color.green, highlight_color=color.lime, position=position, texture='white_cube', origin_y=0.5) def input(self, key): if self.hovered: if key == 'left mouse down': voxel = Voxel(position=self.position + mouse.normal) elif key == 'right mouse down': destroy(self) class Sky(Entity): def __init__(self): super().__init__( parent=scene, model='sphere', texture='skybox', scale=150, double_sided=True) class Hand(Entity): def __init__(self): super().__init__( parent=camera.ui, model='assets/arm', texture='assets/arm_texture', scale=0.2, rotation=Vec3(150,-10,0), position=Vec2(0.4,-0.6)) app = Ursina() sky = Sky() hand = Hand() for z in range(20): for x in range(20): voxel = Voxel(position=(x,0,z)) app.run()