diff --git a/assets/materials/dirt.tres b/assets/materials/dirt.tres index dcb28ce..b01f30e 100644 --- a/assets/materials/dirt.tres +++ b/assets/materials/dirt.tres @@ -1,6 +1,6 @@ [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://uex0dq00xomt"] -[ext_resource type="Texture2D" uid="uid://li36txj7oweq" path="res://assets/textures/dirt.png" id="1_jy2vk"] +[ext_resource type="Texture2D" uid="uid://cm4x631rtdmrq" path="res://assets/textures/dirt-block.png" id="1_jy2vk"] [resource] albedo_texture = ExtResource("1_jy2vk") diff --git a/assets/materials/leaves.tres b/assets/materials/leaves.tres index 669313d..f2dcb57 100644 --- a/assets/materials/leaves.tres +++ b/assets/materials/leaves.tres @@ -1,6 +1,6 @@ [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://d15n1p3spu3jg"] -[ext_resource type="Texture2D" uid="uid://goygbpyqhych" path="res://assets/textures/leaves.png" id="1_sli0o"] +[ext_resource type="Texture2D" uid="uid://cmtiotn1g7wxv" path="res://assets/textures/leaves-block.png" id="1_sli0o"] [resource] transparency = 1 diff --git a/assets/materials/stone.tres b/assets/materials/stone.tres index a4f685c..a3176e2 100644 --- a/assets/materials/stone.tres +++ b/assets/materials/stone.tres @@ -1,6 +1,6 @@ [gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://cx7m27qa4ds4s"] -[ext_resource type="Texture2D" uid="uid://ct1iawpfkdf5l" path="res://assets/textures/stone.png" id="1_vwsbh"] +[ext_resource type="Texture2D" uid="uid://ohcuqkbit3mc" path="res://assets/textures/stone-block.png" id="1_vwsbh"] [resource] albedo_texture = ExtResource("1_vwsbh") diff --git a/assets/materials/wood.tres b/assets/materials/wood.tres new file mode 100644 index 0000000..7841004 --- /dev/null +++ b/assets/materials/wood.tres @@ -0,0 +1,9 @@ +[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://jearv8lmwhec"] + +[ext_resource type="Texture2D" uid="uid://de2ll7i47211v" path="res://assets/textures/wood-block.png" id="1_7x6pw"] + +[resource] +albedo_texture = ExtResource("1_7x6pw") +metallic_specular = 0.0 +roughness = 0.0 +texture_filter = 0 diff --git a/assets/materials/wood_ends.tres b/assets/materials/wood_ends.tres deleted file mode 100644 index 7b03538..0000000 --- a/assets/materials/wood_ends.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://bnqiumcb3ixan"] - -[ext_resource type="Texture2D" uid="uid://dxh0tr1jn2sym" path="res://assets/textures/wood-end.png" id="1_vqb8t"] - -[resource] -albedo_texture = ExtResource("1_vqb8t") -metallic_specular = 0.0 -roughness = 0.0 -texture_filter = 0 diff --git a/assets/materials/wood_side.tres b/assets/materials/wood_side.tres deleted file mode 100644 index 2466568..0000000 --- a/assets/materials/wood_side.tres +++ /dev/null @@ -1,9 +0,0 @@ -[gd_resource type="StandardMaterial3D" load_steps=2 format=3 uid="uid://h0naiw6swfkl"] - -[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood-side.png" id="1_voafl"] - -[resource] -albedo_texture = ExtResource("1_voafl") -metallic_specular = 0.0 -roughness = 0.0 -texture_filter = 0 diff --git a/assets/textures/dirt-block.png b/assets/textures/dirt-block.png new file mode 100644 index 0000000..2161d3c Binary files /dev/null and b/assets/textures/dirt-block.png differ diff --git a/assets/textures/wood-end.png.import b/assets/textures/dirt-block.png.import similarity index 68% rename from assets/textures/wood-end.png.import rename to assets/textures/dirt-block.png.import index 4b317b2..516a0e5 100644 --- a/assets/textures/wood-end.png.import +++ b/assets/textures/dirt-block.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://dxh0tr1jn2sym" -path="res://.godot/imported/wood-end.png-880ae7062d85d2bd8bfc66b6bcdb95a8.ctex" +uid="uid://cm4x631rtdmrq" +path="res://.godot/imported/dirt-block.png-bfe7e3792ac49118c2f92d8dedccd3b1.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/wood-end.png" -dest_files=["res://.godot/imported/wood-end.png-880ae7062d85d2bd8bfc66b6bcdb95a8.ctex"] +source_file="res://assets/textures/dirt-block.png" +dest_files=["res://.godot/imported/dirt-block.png-bfe7e3792ac49118c2f92d8dedccd3b1.ctex"] [params] diff --git a/assets/textures/grass-block.png b/assets/textures/grass-block.png new file mode 100644 index 0000000..ed0a4dd Binary files /dev/null and b/assets/textures/grass-block.png differ diff --git a/assets/textures/grass-block.png.import b/assets/textures/grass-block.png.import new file mode 100644 index 0000000..13f5b2a --- /dev/null +++ b/assets/textures/grass-block.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dsvk3faenewrl" +path.s3tc="res://.godot/imported/grass-block.png-a43533c53e78ccd42111c48d59e43ebf.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/grass-block.png" +dest_files=["res://.godot/imported/grass-block.png-a43533c53e78ccd42111c48d59e43ebf.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/textures/dirt-grass.png b/assets/textures/grass.png similarity index 100% rename from assets/textures/dirt-grass.png rename to assets/textures/grass.png diff --git a/assets/textures/dirt-grass.png.import b/assets/textures/grass.png.import similarity index 71% rename from assets/textures/dirt-grass.png.import rename to assets/textures/grass.png.import index 9b5dc53..15da399 100644 --- a/assets/textures/dirt-grass.png.import +++ b/assets/textures/grass.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bgo4mb3atmbot" -path="res://.godot/imported/dirt-grass.png-12fb5ebf1f814e95cc24f2d6fd063398.ctex" +path="res://.godot/imported/grass.png-44de1b601ed5e0482c9aa195977ab90c.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/dirt-grass.png" -dest_files=["res://.godot/imported/dirt-grass.png-12fb5ebf1f814e95cc24f2d6fd063398.ctex"] +source_file="res://assets/textures/grass.png" +dest_files=["res://.godot/imported/grass.png-44de1b601ed5e0482c9aa195977ab90c.ctex"] [params] diff --git a/assets/textures/leaves-block.png b/assets/textures/leaves-block.png new file mode 100644 index 0000000..a79438c Binary files /dev/null and b/assets/textures/leaves-block.png differ diff --git a/assets/textures/leaves-block.png.import b/assets/textures/leaves-block.png.import new file mode 100644 index 0000000..7459703 --- /dev/null +++ b/assets/textures/leaves-block.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cmtiotn1g7wxv" +path.s3tc="res://.godot/imported/leaves-block.png-c01c16272b530ade3ca524610fc204a6.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/leaves-block.png" +dest_files=["res://.godot/imported/leaves-block.png-c01c16272b530ade3ca524610fc204a6.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/textures/stone-block.png b/assets/textures/stone-block.png new file mode 100644 index 0000000..eb39f5e Binary files /dev/null and b/assets/textures/stone-block.png differ diff --git a/assets/textures/stone-block.png.import b/assets/textures/stone-block.png.import new file mode 100644 index 0000000..a0a6780 --- /dev/null +++ b/assets/textures/stone-block.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ohcuqkbit3mc" +path.s3tc="res://.godot/imported/stone-block.png-7d1af345ce6c8bdaa19899a5ad89c6da.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/stone-block.png" +dest_files=["res://.godot/imported/stone-block.png-7d1af345ce6c8bdaa19899a5ad89c6da.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/textures/wood-block.png b/assets/textures/wood-block.png new file mode 100644 index 0000000..87ea7cf Binary files /dev/null and b/assets/textures/wood-block.png differ diff --git a/assets/textures/wood-block.png.import b/assets/textures/wood-block.png.import new file mode 100644 index 0000000..5cad896 --- /dev/null +++ b/assets/textures/wood-block.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://de2ll7i47211v" +path.s3tc="res://.godot/imported/wood-block.png-443d7f141af0d10d126bdfee9ade4138.s3tc.ctex" +metadata={ +"imported_formats": ["s3tc_bptc"], +"vram_texture": true +} + +[deps] + +source_file="res://assets/textures/wood-block.png" +dest_files=["res://.godot/imported/wood-block.png-443d7f141af0d10d126bdfee9ade4138.s3tc.ctex"] + +[params] + +compress/mode=2 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=0 diff --git a/assets/textures/wood-end.png b/assets/textures/wood-end.png deleted file mode 100644 index f54b654..0000000 Binary files a/assets/textures/wood-end.png and /dev/null differ diff --git a/assets/textures/wood-side.png b/assets/textures/wood.png similarity index 100% rename from assets/textures/wood-side.png rename to assets/textures/wood.png diff --git a/assets/textures/wood-side.png.import b/assets/textures/wood.png.import similarity index 71% rename from assets/textures/wood-side.png.import rename to assets/textures/wood.png.import index 99ba7d9..68e3ec8 100644 --- a/assets/textures/wood-side.png.import +++ b/assets/textures/wood.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://0mw651622h01" -path="res://.godot/imported/wood-side.png-7d9834bbc960a2c99991aedb7dcfa31e.ctex" +path="res://.godot/imported/wood.png-eeb3ea6fc91501562e05b28492ed90b0.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/textures/wood-side.png" -dest_files=["res://.godot/imported/wood-side.png-7d9834bbc960a2c99991aedb7dcfa31e.ctex"] +source_file="res://assets/textures/wood.png" +dest_files=["res://.godot/imported/wood.png-eeb3ea6fc91501562e05b28492ed90b0.ctex"] [params] diff --git a/resources/block_resource.gd b/resources/block_resource.gd index e4183e5..1a1d36c 100644 --- a/resources/block_resource.gd +++ b/resources/block_resource.gd @@ -2,10 +2,4 @@ class_name BlockResource extends ItemResource -## East material is also the default material if not provided -@export var material_east: StandardMaterial3D = null -@export var material_west: StandardMaterial3D = null -@export var material_north: StandardMaterial3D = null -@export var material_south: StandardMaterial3D = null -@export var material_top: StandardMaterial3D = null -@export var material_bottom: StandardMaterial3D = null +@export var material_texture: StandardMaterial3D = null diff --git a/resources/blocks/001_dirt.tres b/resources/blocks/001_dirt.tres index efd0ad1..c23d380 100644 --- a/resources/blocks/001_dirt.tres +++ b/resources/blocks/001_dirt.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_ljghb") -material_east = ExtResource("1_n1cq6") +material_texture = ExtResource("1_n1cq6") id = "001" name = "Dirt" amount = 0 diff --git a/resources/blocks/002_stone.tres b/resources/blocks/002_stone.tres index 8e5d3d1..2021f32 100644 --- a/resources/blocks/002_stone.tres +++ b/resources/blocks/002_stone.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("1_63t5s") -material_east = ExtResource("1_6chm7") +material_texture = ExtResource("1_6chm7") id = "002" name = "Stone" amount = 0 diff --git a/resources/blocks/003_wood.tres b/resources/blocks/003_wood.tres index ae533ae..733d980 100644 --- a/resources/blocks/003_wood.tres +++ b/resources/blocks/003_wood.tres @@ -1,17 +1,11 @@ -[gd_resource type="Resource" script_class="BlockResource" load_steps=4 format=3 uid="uid://bvudydis6w27b"] +[gd_resource type="Resource" script_class="BlockResource" load_steps=3 format=3 uid="uid://bvudydis6w27b"] -[ext_resource type="Material" uid="uid://bnqiumcb3ixan" path="res://assets/materials/wood_ends.tres" id="1_1n8h6"] +[ext_resource type="Material" uid="uid://jearv8lmwhec" path="res://assets/materials/wood.tres" id="1_plhol"] [ext_resource type="Script" uid="uid://dwrmy4mx0mw18" path="res://resources/block_resource.gd" id="2_1n8h6"] -[ext_resource type="Material" uid="uid://h0naiw6swfkl" path="res://assets/materials/wood_side.tres" id="2_o823h"] [resource] script = ExtResource("2_1n8h6") -material_east = ExtResource("2_o823h") -material_west = ExtResource("2_o823h") -material_north = ExtResource("2_o823h") -material_south = ExtResource("2_o823h") -material_top = ExtResource("1_1n8h6") -material_bottom = ExtResource("1_1n8h6") +material_texture = ExtResource("1_plhol") id = "003" name = "Wood" amount = 0 diff --git a/resources/blocks/004_leaves.tres b/resources/blocks/004_leaves.tres index 7a32786..4366e69 100644 --- a/resources/blocks/004_leaves.tres +++ b/resources/blocks/004_leaves.tres @@ -5,7 +5,7 @@ [resource] script = ExtResource("3_kuops") -material_east = ExtResource("1_dbmit") +material_texture = ExtResource("1_dbmit") id = "004" name = "Leaves" amount = 0 diff --git a/resources/inventory/player_inventory_testing.tres b/resources/inventory/player_inventory_testing.tres index 87921a6..041b1d2 100644 --- a/resources/inventory/player_inventory_testing.tres +++ b/resources/inventory/player_inventory_testing.tres @@ -1,17 +1,16 @@ -[gd_resource type="Resource" script_class="InventoryResource" load_steps=13 format=3 uid="uid://blfp6tiir282o"] +[gd_resource type="Resource" script_class="InventoryResource" load_steps=12 format=3 uid="uid://blfp6tiir282o"] [ext_resource type="Script" uid="uid://becun6dj78v8d" path="res://resources/inventory_resource.gd" id="1_4v6mg"] [ext_resource type="Script" uid="uid://bdx4q355l5ugl" path="res://resources/item_resource.gd" id="1_gg8jx"] [ext_resource type="Material" uid="uid://uex0dq00xomt" path="res://assets/materials/dirt.tres" id="2_8w148"] [ext_resource type="Script" uid="uid://dwrmy4mx0mw18" path="res://resources/block_resource.gd" id="3_vgvac"] [ext_resource type="Material" uid="uid://cx7m27qa4ds4s" path="res://assets/materials/stone.tres" id="4_7yuhn"] -[ext_resource type="Material" uid="uid://bnqiumcb3ixan" path="res://assets/materials/wood_ends.tres" id="5_viap3"] -[ext_resource type="Material" uid="uid://h0naiw6swfkl" path="res://assets/materials/wood_side.tres" id="6_wqat2"] +[ext_resource type="Material" uid="uid://jearv8lmwhec" path="res://assets/materials/wood.tres" id="5_p27bu"] [ext_resource type="Material" uid="uid://d15n1p3spu3jg" path="res://assets/materials/leaves.tres" id="7_xd1nd"] [sub_resource type="Resource" id="Resource_jaam2"] script = ExtResource("3_vgvac") -material_east = ExtResource("2_8w148") +material_texture = ExtResource("2_8w148") id = "001" name = "Dirt" amount = 100 @@ -21,7 +20,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18" [sub_resource type="Resource" id="Resource_4kby3"] script = ExtResource("3_vgvac") -material_east = ExtResource("4_7yuhn") +material_texture = ExtResource("4_7yuhn") id = "002" name = "Stone" amount = 100 @@ -31,12 +30,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18" [sub_resource type="Resource" id="Resource_byct5"] script = ExtResource("3_vgvac") -material_east = ExtResource("6_wqat2") -material_west = ExtResource("6_wqat2") -material_north = ExtResource("6_wqat2") -material_south = ExtResource("6_wqat2") -material_top = ExtResource("5_viap3") -material_bottom = ExtResource("5_viap3") +material_texture = ExtResource("5_p27bu") id = "003" name = "Wood" amount = 100 @@ -46,7 +40,7 @@ metadata/_custom_type_script = "uid://dwrmy4mx0mw18" [sub_resource type="Resource" id="Resource_qycqj"] script = ExtResource("3_vgvac") -material_east = ExtResource("7_xd1nd") +material_texture = ExtResource("7_xd1nd") id = "004" name = "Leaves" amount = 100 diff --git a/scenes/blocks/block.gd b/scenes/blocks/block.gd index e3f64cb..e00eb39 100644 --- a/scenes/blocks/block.gd +++ b/scenes/blocks/block.gd @@ -4,13 +4,7 @@ extends StaticBody3D @onready var collision_shape: CollisionShape3D = $CollisionShape3D @onready var highlight_mesh: MeshInstance3D = $HighlightMesh - -@onready var east_face: MeshInstance3D = $BlockFaces/EastFace -@onready var west_face: MeshInstance3D = $BlockFaces/WestFace -@onready var north_face: MeshInstance3D = $BlockFaces/NorthFace -@onready var south_face: MeshInstance3D = $BlockFaces/SouthFace -@onready var top_face: MeshInstance3D = $BlockFaces/TopFace -@onready var bottom_face: MeshInstance3D = $BlockFaces/BottomFace +@onready var block_mesh: MeshInstance3D = $BlockMesh var id: String var resource: BlockResource @@ -21,7 +15,7 @@ func _exit_tree() -> void: Waila.ref.release_target() func _ready() -> void: - _apply_materials() + _apply_material() func get_id() -> String: @@ -43,28 +37,13 @@ func release() -> void: func set_id(block_id: String) -> void: id = block_id _load_resource_data() - _apply_materials() - + _apply_material() -## Apply a specific material to a MeshInstance3D -## If material is null, the EastFace material from the BlockResource will be utilized -func _apply_material(face: MeshInstance3D, material: StandardMaterial3D) -> void: - if material == null: - material = resource.material_east # Default to East face (first) - face.set_surface_override_material(0, material) - -func _apply_materials() -> void: - if east_face == null: return +func _apply_material() -> void: + if block_mesh == null: return if resource == null: return - - # This could probably be improved/simplified - _apply_material(east_face, resource.material_east) - _apply_material(west_face, resource.material_west) - _apply_material(north_face, resource.material_north) - _apply_material(south_face, resource.material_south) - _apply_material(top_face, resource.material_top) - _apply_material(bottom_face, resource.material_bottom) + block_mesh.set_surface_override_material(0, resource.material_texture) func _load_resource_data() -> void: if not id: diff --git a/scenes/blocks/block.tscn b/scenes/blocks/block.tscn index 246a63c..6334e95 100644 --- a/scenes/blocks/block.tscn +++ b/scenes/blocks/block.tscn @@ -1,54 +1,31 @@ -[gd_scene load_steps=6 format=3 uid="uid://col07xd76y60h"] +[gd_scene load_steps=8 format=3 uid="uid://b8evbp40gnomt"] [ext_resource type="Script" uid="uid://buvqmrrtmxs2h" path="res://scenes/blocks/block.gd" id="1_7fut1"] [ext_resource type="Material" uid="uid://bgc6efqf8aiqo" path="res://assets/materials/block_highlight.tres" id="2_524ei"] +[ext_resource type="Texture2D" uid="uid://dsvk3faenewrl" path="res://assets/textures/grass-block.png" id="3_qi7hx"] [sub_resource type="BoxShape3D" id="BoxShape3D_n5naa"] -[sub_resource type="QuadMesh" id="QuadMesh_n5naa"] - [sub_resource type="BoxMesh" id="BoxMesh_7fut1"] material = ExtResource("2_524ei") size = Vector3(1.01, 1.01, 1.01) +[sub_resource type="BoxMesh" id="BoxMesh_e15ke"] + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_4e127"] +albedo_texture = ExtResource("3_qi7hx") +texture_filter = 0 + [node name="Block" type="StaticBody3D"] script = ExtResource("1_7fut1") [node name="CollisionShape3D" type="CollisionShape3D" parent="."] shape = SubResource("BoxShape3D_n5naa") -[node name="BlockFaces" type="Node3D" parent="."] - -[node name="EastFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.5) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - -[node name="WestFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 0, 0, -0.5) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - -[node name="NorthFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(-1.3411e-07, 0, -1, 0, 1, 0, 1, 0, -1.3411e-07, -0.5, 0, 7.45058e-09) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - -[node name="SouthFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0.5, 0, 0) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - -[node name="TopFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(1.91069e-15, -1, -4.37114e-08, -4.37114e-08, -4.37114e-08, 1, -1, 0, -4.37114e-08, 0, 0.5, 0) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - -[node name="BottomFace" type="MeshInstance3D" parent="BlockFaces"] -transform = Transform3D(-4.37114e-08, 1, -4.37114e-08, 0, -4.37114e-08, -1, -1, -4.37114e-08, 1.91069e-15, 0, -0.5, 0) -mesh = SubResource("QuadMesh_n5naa") -skeleton = NodePath("../..") - [node name="HighlightMesh" type="MeshInstance3D" parent="."] visible = false mesh = SubResource("BoxMesh_7fut1") + +[node name="BlockMesh" type="MeshInstance3D" parent="."] +mesh = SubResource("BoxMesh_e15ke") +surface_material_override/0 = SubResource("StandardMaterial3D_4e127") diff --git a/scenes/blocks/dropped_block.tscn b/scenes/blocks/dropped_block.tscn index 05cc913..a813d93 100644 --- a/scenes/blocks/dropped_block.tscn +++ b/scenes/blocks/dropped_block.tscn @@ -1,10 +1,7 @@ [gd_scene load_steps=7 format=3 uid="uid://bn2olldntd7a6"] [ext_resource type="Script" uid="uid://dkd2qbndc3q1o" path="res://scenes/blocks/dropped_block.gd" id="1_50ggx"] -[ext_resource type="PackedScene" uid="uid://col07xd76y60h" path="res://scenes/blocks/block.tscn" id="1_chlk1"] - -[sub_resource type="SphereShape3D" id="SphereShape3D_5kft2"] -radius = 1.0 +[ext_resource type="PackedScene" uid="uid://b8evbp40gnomt" path="res://scenes/blocks/block.tscn" id="3_qtifl"] [sub_resource type="Animation" id="Animation_kym7p"] length = 0.001 @@ -30,7 +27,7 @@ tracks/1/keys = { "times": PackedFloat32Array(0), "transitions": PackedFloat32Array(1), "update": 0, -"values": [Vector3(0, 0, 0.261799)] +"values": [Vector3(0, 0, 0)] } [sub_resource type="Animation" id="Animation_50ggx"] @@ -69,23 +66,26 @@ _data = { &"start_animation": SubResource("Animation_50ggx") } +[sub_resource type="SphereShape3D" id="SphereShape3D_5kft2"] +radius = 1.0 + [node name="DroppedBlock" type="Node3D"] script = ExtResource("1_50ggx") -[node name="Block" parent="." instance=ExtResource("1_chlk1")] -transform = Transform3D(0.965926, -0.258819, 0, 0.258819, 0.965926, 0, 0, 0, 1, 0, 0, 0) +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +libraries = { +&"": SubResource("AnimationLibrary_kym7p") +} +autoplay = "start_animation" + +[node name="Block" parent="." instance=ExtResource("3_qtifl")] [node name="PickupArea" type="Area3D" parent="Block"] +transform = Transform3D(0.965926, -0.258819, 0, 0.258819, 0.965926, 0, 0, 0, 1, 0, 0, 0) collision_layer = 4 collision_mask = 2 [node name="CollisionShape3D" type="CollisionShape3D" parent="Block/PickupArea"] shape = SubResource("SphereShape3D_5kft2") -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -libraries = { -&"": SubResource("AnimationLibrary_kym7p") -} -autoplay = "start_animation" - [connection signal="body_entered" from="Block/PickupArea" to="." method="_on_pickup_area_body_entered"] diff --git a/scenes/ui/quick_slots.tscn b/scenes/ui/quick_slots.tscn index 83d81cc..1d1ab07 100644 --- a/scenes/ui/quick_slots.tscn +++ b/scenes/ui/quick_slots.tscn @@ -3,7 +3,7 @@ [ext_resource type="Script" uid="uid://bcq6vexsmyeol" path="res://scenes/ui/quick_slots.gd" id="1_cqw2g"] [ext_resource type="Texture2D" uid="uid://li36txj7oweq" path="res://assets/textures/dirt.png" id="2_kotkb"] [ext_resource type="Texture2D" uid="uid://ct1iawpfkdf5l" path="res://assets/textures/stone.png" id="3_cqw2g"] -[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood-side.png" id="4_yyyxx"] +[ext_resource type="Texture2D" uid="uid://0mw651622h01" path="res://assets/textures/wood.png" id="4_yyyxx"] [ext_resource type="Texture2D" uid="uid://goygbpyqhych" path="res://assets/textures/leaves.png" id="5_ps55n"] [node name="QuickSlots" type="MarginContainer"]