├── assets ├── Sans.png ├── arm.blend ├── arm.blend1 ├── skybox.png ├── dirt_block.png ├── Grass_block.blend ├── arm_texture.png ├── arm_texture.psd ├── brick_block.png ├── grass_block.png ├── punch_sound.wav ├── stone_block.png ├── block_textures.psd ├── arm.mtl ├── block.mtl ├── block.obj ├── arm.obj └── punch.xmp ├── ursina_intro.py └── UrsaCraft_video.py /assets/Sans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/Sans.png -------------------------------------------------------------------------------- /assets/arm.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/arm.blend -------------------------------------------------------------------------------- /assets/arm.blend1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/arm.blend1 -------------------------------------------------------------------------------- /assets/skybox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/skybox.png -------------------------------------------------------------------------------- /assets/dirt_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/dirt_block.png -------------------------------------------------------------------------------- /assets/Grass_block.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/Grass_block.blend -------------------------------------------------------------------------------- /assets/arm_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/arm_texture.png -------------------------------------------------------------------------------- /assets/arm_texture.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/arm_texture.psd -------------------------------------------------------------------------------- /assets/brick_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/brick_block.png -------------------------------------------------------------------------------- /assets/grass_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/grass_block.png -------------------------------------------------------------------------------- /assets/punch_sound.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/punch_sound.wav -------------------------------------------------------------------------------- /assets/stone_block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/stone_block.png -------------------------------------------------------------------------------- /assets/block_textures.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clear-code-projects/Minecraft-in-Python/HEAD/assets/block_textures.psd -------------------------------------------------------------------------------- /assets/arm.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'arm.blend' 2 | # Material Count: 1 3 | 4 | newmtl Arm 5 | Ns 0.297520 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.315152 0.315152 0.315152 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.450000 11 | d 1.000000 12 | illum 2 13 | map_Kd arm.png 14 | -------------------------------------------------------------------------------- /assets/block.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl Stone 5 | Ns 225.000000 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.450000 11 | d 1.000000 12 | illum 2 13 | map_Kd grass_block.png 14 | -------------------------------------------------------------------------------- /assets/block.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.81 (sub 16) OBJ File: '' 2 | # www.blender.org 3 | mtllib block.mtl 4 | o Cube 5 | v -1.000000 -1.000000 1.000000 6 | v -1.000000 1.000000 1.000000 7 | v -1.000000 -1.000000 -1.000000 8 | v -1.000000 1.000000 -1.000000 9 | v 1.000000 -1.000000 1.000000 10 | v 1.000000 1.000000 1.000000 11 | v 1.000000 -1.000000 -1.000000 12 | v 1.000000 1.000000 -1.000000 13 | vt 0.375000 0.000000 14 | vt 0.625000 0.000000 15 | vt 0.625000 0.250000 16 | vt 0.375000 0.250000 17 | vt 0.625000 0.500000 18 | vt 0.375000 0.500000 19 | vt 0.625000 0.750000 20 | vt 0.375000 0.750000 21 | vt 0.625000 1.000000 22 | vt 0.375000 1.000000 23 | vt 0.125000 0.500000 24 | vt 0.125000 0.750000 25 | vt 0.875000 0.500000 26 | vt 0.875000 0.750000 27 | vn -1.0000 0.0000 0.0000 28 | vn 0.0000 0.0000 -1.0000 29 | vn 1.0000 0.0000 0.0000 30 | vn 0.0000 0.0000 1.0000 31 | vn 0.0000 -1.0000 0.0000 32 | vn 0.0000 1.0000 0.0000 33 | usemtl Stone 34 | s off 35 | f 1/1/1 2/2/1 4/3/1 3/4/1 36 | f 3/4/2 4/3/2 8/5/2 7/6/2 37 | f 7/6/3 8/5/3 6/7/3 5/8/3 38 | f 5/8/4 6/7/4 2/9/4 1/10/4 39 | f 3/11/5 7/6/5 5/8/5 1/12/5 40 | f 8/5/6 4/13/6 2/14/6 6/7/6 41 | -------------------------------------------------------------------------------- /assets/arm.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.83.0 OBJ File: 'arm.blend' 2 | # www.blender.org 3 | mtllib arm.mtl 4 | o Cube_Cube.001 5 | v 0.000000 -0.500000 0.000000 6 | v 0.000000 0.500000 0.000000 7 | v 0.000000 -0.500000 -3.000000 8 | v 0.000000 0.500000 -3.000000 9 | v 1.000000 -0.500000 0.000000 10 | v 1.000000 0.500000 0.000000 11 | v 1.000000 -0.500000 -3.000000 12 | v 1.000000 0.500000 -3.000000 13 | vt 0.930330 0.500000 14 | vt 0.930330 0.622951 15 | vt 0.561476 0.622951 16 | vt 0.561476 0.500000 17 | vt 0.438524 0.622951 18 | vt 0.438524 0.500000 19 | vt 0.069670 0.622951 20 | vt 0.069670 0.500000 21 | vt 0.438524 0.131146 22 | vt 0.438524 0.008194 23 | vt 0.561476 0.008194 24 | vt 0.561476 0.131146 25 | vt 0.561476 0.991806 26 | vt 0.438524 0.991806 27 | vn -1.0000 0.0000 0.0000 28 | vn 0.0000 0.0000 -1.0000 29 | vn 1.0000 0.0000 0.0000 30 | vn 0.0000 0.0000 1.0000 31 | vn 0.0000 -1.0000 0.0000 32 | vn 0.0000 1.0000 0.0000 33 | usemtl Arm 34 | s off 35 | f 1/1/1 2/2/1 4/3/1 3/4/1 36 | f 3/4/2 4/3/2 8/5/2 7/6/2 37 | f 7/6/3 8/5/3 6/7/3 5/8/3 38 | f 5/9/4 6/10/4 2/11/4 1/12/4 39 | f 3/4/5 7/6/5 5/9/5 1/12/5 40 | f 8/5/6 4/3/6 2/13/6 6/14/6 41 | -------------------------------------------------------------------------------- /ursina_intro.py: -------------------------------------------------------------------------------- 1 | from ursina import * 2 | 3 | # Test Cube 4 | class Test_cube(Entity): 5 | def __init__(self): 6 | super().__init__( 7 | parent = scene, 8 | model = 'cube', 9 | texture = 'white_cube', 10 | rotation = Vec3(45,45,45)) 11 | 12 | # Test button 13 | class Test_button(Button): 14 | def __init__(self,scale = 0.1): 15 | super().__init__( 16 | parent = scene, 17 | model = 'cube', 18 | texture = 'brick', 19 | color = color.white, 20 | highlight_color = color.red, 21 | pressed_color = color.lime) 22 | 23 | def input(self,key): 24 | if self.hovered: 25 | if key == 'left mouse down': 26 | punch_sound.play() 27 | 28 | 29 | # update is run every frame 30 | def update(): 31 | #print('test') 32 | if held_keys['a']: 33 | cube.x -= 1 * time.dt 34 | 35 | # basic window 36 | app = Ursina() 37 | 38 | # basic cube 39 | cube = Entity(model='quad', color=color.orange, scale = (2,5), position = (5,1)) 40 | 41 | # quad with texture 42 | #sans_image = load_texture('Sans.png') 43 | #sans = Entity(model = 'quad', texture = sans_image) 44 | #sans = Entity(model = 'quad', texture = 'Sans.png') 45 | 46 | # creating a block properly 47 | test = Test_cube() 48 | 49 | # creating a button 50 | btn = Test_button() 51 | punch_sound = Audio('assets/punch', loop=False, autoplay=False) 52 | 53 | app.run() 54 | 55 | -------------------------------------------------------------------------------- /UrsaCraft_video.py: -------------------------------------------------------------------------------- 1 | from ursina import * 2 | from ursina.prefabs.first_person_controller import FirstPersonController 3 | 4 | app = Ursina() 5 | grass_texture = load_texture('assets/grass_block.png') 6 | stone_texture = load_texture('assets/stone_block.png') 7 | brick_texture = load_texture('assets/brick_block.png') 8 | dirt_texture = load_texture('assets/dirt_block.png') 9 | sky_texture = load_texture('assets/skybox.png') 10 | arm_texture = load_texture('assets/arm_texture.png') 11 | punch_sound = Audio('assets/punch_sound',loop = False, autoplay = False) 12 | block_pick = 1 13 | 14 | window.fps_counter.enabled = False 15 | window.exit_button.visible = False 16 | 17 | def update(): 18 | global block_pick 19 | 20 | if held_keys['left mouse'] or held_keys['right mouse']: 21 | hand.active() 22 | else: 23 | hand.passive() 24 | 25 | if held_keys['1']: block_pick = 1 26 | if held_keys['2']: block_pick = 2 27 | if held_keys['3']: block_pick = 3 28 | if held_keys['4']: block_pick = 4 29 | 30 | class Voxel(Button): 31 | def __init__(self, position = (0,0,0), texture = grass_texture): 32 | super().__init__( 33 | parent = scene, 34 | position = position, 35 | model = 'assets/block', 36 | origin_y = 0.5, 37 | texture = texture, 38 | color = color.color(0,0,random.uniform(0.9,1)), 39 | scale = 0.5) 40 | 41 | def input(self,key): 42 | if self.hovered: 43 | if key == 'left mouse down': 44 | punch_sound.play() 45 | if block_pick == 1: voxel = Voxel(position = self.position + mouse.normal, texture = grass_texture) 46 | if block_pick == 2: voxel = Voxel(position = self.position + mouse.normal, texture = stone_texture) 47 | if block_pick == 3: voxel = Voxel(position = self.position + mouse.normal, texture = brick_texture) 48 | if block_pick == 4: voxel = Voxel(position = self.position + mouse.normal, texture = dirt_texture) 49 | 50 | if key == 'right mouse down': 51 | punch_sound.play() 52 | destroy(self) 53 | 54 | class Sky(Entity): 55 | def __init__(self): 56 | super().__init__( 57 | parent = scene, 58 | model = 'sphere', 59 | texture = sky_texture, 60 | scale = 150, 61 | double_sided = True) 62 | 63 | class Hand(Entity): 64 | def __init__(self): 65 | super().__init__( 66 | parent = camera.ui, 67 | model = 'assets/arm', 68 | texture = arm_texture, 69 | scale = 0.2, 70 | rotation = Vec3(150,-10,0), 71 | position = Vec2(0.4,-0.6)) 72 | 73 | def active(self): 74 | self.position = Vec2(0.3,-0.5) 75 | 76 | def passive(self): 77 | self.position = Vec2(0.4,-0.6) 78 | 79 | for z in range(20): 80 | for x in range(20): 81 | voxel = Voxel(position = (x,0,z)) 82 | 83 | player = FirstPersonController() 84 | sky = Sky() 85 | hand = Hand() 86 | 87 | app.run() -------------------------------------------------------------------------------- /assets/punch.xmp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | 13 | 14 | CuePoint Markers 15 | Cue 16 | f44100 17 | 18 | 19 | CD Track Markers 20 | Track 21 | f44100 22 | 23 | 24 | Subclip Markers 25 | InOut 26 | f44100 27 | 28 | 29 | 30 | 2020-11-30T21:02:06Z 31 | 2020-11-30T21:02:06Z 32 | xmp.iid:d014fa67-e7e1-154a-b2d4-79210a0240b4 33 | xmp.did:d014fa67-e7e1-154a-b2d4-79210a0240b4 34 | xmp.did:2825da43-b730-0a47-9090-961c6d284b13 35 | 36 | 37 | 38 | saved 39 | xmp.iid:2825da43-b730-0a47-9090-961c6d284b13 40 | 2020-11-30T21:02:06Z 41 | Adobe Audition 13.0 (Windows) 42 | /metadata 43 | 44 | 45 | saved 46 | xmp.iid:d014fa67-e7e1-154a-b2d4-79210a0240b4 47 | 2020-11-30T21:02:06Z 48 | Adobe Audition 13.0 (Windows) 49 | / 50 | 51 | 52 | 53 | 54 | xmp.iid:2825da43-b730-0a47-9090-961c6d284b13 55 | xmp.did:2825da43-b730-0a47-9090-961c6d284b13 56 | xmp.did:2825da43-b730-0a47-9090-961c6d284b13 57 | 58 | audio/ogg; codec="vorbis" 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | --------------------------------------------------------------------------------