working on picking up arrows

This commit is contained in:
derek
2025-06-26 17:04:35 -05:00
parent af5ff6f284
commit 64310b848b
37 changed files with 492 additions and 106 deletions

View File

@@ -34,38 +34,53 @@ anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="BoxContainer" type="BoxContainer" parent="Camera3D/Control"]
layout_mode = 1
offset_right = 3400.0
[node name="VBoxContainer2" type="VBoxContainer" parent="Camera3D/Control"]
layout_mode = 2
offset_right = 330.0
offset_bottom = 1440.0
size_flags_horizontal = 0
[node name="VBoxContainer" type="VBoxContainer" parent="Camera3D/Control/BoxContainer"]
custom_minimum_size = Vector2(236.82, 3.065)
[node name="GOLD" type="Label" parent="Camera3D/Control/VBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 8
size_flags_vertical = 0
theme = ExtResource("3_8uhk6")
text = "Gold: 35"
[node name="HealthBar" type="ProgressBar" parent="Camera3D/Control/BoxContainer/VBoxContainer"]
[node name="Arrows" type="Label" parent="Camera3D/Control/VBoxContainer2"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("3_8uhk6")
text = "Arrows"
[node name="VBoxContainer" type="VBoxContainer" parent="Camera3D/Control"]
custom_minimum_size = Vector2(236.82, 3.065)
layout_mode = 1
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
offset_top = -120.0
offset_right = 236.82
grow_vertical = 0
size_flags_horizontal = 0
size_flags_vertical = 8
alignment = 2
[node name="HealthBar" type="ProgressBar" parent="Camera3D/Control/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 10
theme = ExtResource("3_8uhk6")
theme_override_styles/fill = SubResource("StyleBoxFlat_6wc88")
value = 42.34
[node name="StaminaBar" type="ProgressBar" parent="Camera3D/Control/BoxContainer/VBoxContainer"]
[node name="StaminaBar" type="ProgressBar" parent="Camera3D/Control/VBoxContainer"]
layout_mode = 2
size_flags_vertical = 1
theme = ExtResource("3_8uhk6")
theme_override_styles/fill = SubResource("StyleBoxFlat_8uhk6")
value = 42.34
[node name="GOLD" type="Label" parent="Camera3D/Control/BoxContainer"]
layout_mode = 2
size_flags_horizontal = 0
size_flags_vertical = 0
theme = ExtResource("3_8uhk6")
text = "Gold: 35"
[node name="MouseTable" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
collision_layer = 128

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=4 uid="uid://bxye0cuxw1mbr"]
[gd_scene load_steps=11 format=4 uid="uid://bxye0cuxw1mbr"]
[ext_resource type="Material" uid="uid://c1evlkhnj37ky" path="res://Assets/Materials/GoldGlow.tres" id="1_77nlu"]
[ext_resource type="Script" uid="uid://b0crflswpal5l" path="res://Scripts/arrow.gd" id="1_c7yig"]
@@ -73,12 +73,21 @@ _surfaces = [{
blend_shape_mode = 0
shadow_mesh = SubResource("ArrayMesh_62tqx")
[sub_resource type="CylinderShape3D" id="CylinderShape3D_c7yig"]
margin = 0.0
height = 1.77637
radius = 0.1
[sub_resource type="Animation" id="Animation_nc78r"]
length = 0.001
[node name="Arrow" type="MeshInstance3D"]
[sub_resource type="Animation" id="Animation_c7yig"]
resource_name = "despawn"
[sub_resource type="AnimationLibrary" id="AnimationLibrary_nst05"]
_data = {
&"RESET": SubResource("Animation_nc78r"),
&"despawn": SubResource("Animation_c7yig")
}
[sub_resource type="SphereShape3D" id="SphereShape3D_c7yig"]
[node name="Arrow" type="Node3D"]
script = ExtResource("1_c7yig")
[node name="LandDepth" type="Marker3D" parent="."]
@@ -93,11 +102,19 @@ metadata/extras = {
"poliigon_props": {}
}
[node name="ArrowCollider" type="Area3D" parent="."]
transform = Transform3D(1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, -4.88765e-09, -0.875317)
[node name="CollisionShape3D" type="CollisionShape3D" parent="ArrowCollider"]
shape = SubResource("CylinderShape3D_c7yig")
[node name="HitRay" type="RayCast3D" parent="."]
target_position = Vector3(0, 0, -2)
collision_mask = 9
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_nst05")
}
[node name="PickupCollision" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
monitorable = false
[node name="CollisionShape3D" type="CollisionShape3D" parent="PickupCollision"]
shape = SubResource("SphereShape3D_c7yig")

View File

@@ -0,0 +1,12 @@
[gd_scene load_steps=3 format=3 uid="uid://cu6f8karst8uk"]
[ext_resource type="Script" uid="uid://bot4t8im34ldh" path="res://Scripts/cloudSpawner.gd" id="1_t6aj5"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_t6aj5"]
transparency = 1
albedo_color = Color(1, 1, 1, 0)
[node name="CloudSpawner" type="CSGBox3D"]
size = Vector3(57.1482, 23.8151, 69.293)
material = SubResource("StandardMaterial3D_t6aj5")
script = ExtResource("1_t6aj5")

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://bacgd5lmvaxea"]
[gd_scene load_steps=21 format=3 uid="uid://bacgd5lmvaxea"]
[ext_resource type="Script" uid="uid://bcgt64gerg8pv" path="res://Scripts/player.gd" id="1_5wxv7"]
[ext_resource type="Material" uid="uid://b4rpp31c0dx2m" path="res://Assets/Materials/BasicMat.tres" id="1_y6xdh"]
@@ -10,6 +10,7 @@
[ext_resource type="PackedScene" uid="uid://b12w4ut17srje" path="res://Assets/Models/Character1.blend" id="7_juxdh"]
[ext_resource type="PackedScene" uid="uid://bxye0cuxw1mbr" path="res://Prefabs/arrow.tscn" id="7_kgmex"]
[ext_resource type="PackedScene" uid="uid://b4c4cu400yrgt" path="res://Assets/Models/SwordCursor.blend" id="8_4qbli"]
[ext_resource type="PackedScene" uid="uid://jkl8odkxg2s2" path="res://mousedebug.tscn" id="11_2xbkd"]
[sub_resource type="BoxMesh" id="BoxMesh_5wxv7"]
size = Vector3(0.945, 0.13, 0.135)
@@ -88,6 +89,9 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_juxdh"]
radius = 2.5
[sub_resource type="BoxShape3D" id="BoxShape3D_2xbkd"]
size = Vector3(1, 3.50049, 1.52917)
[node name="Player" type="CharacterBody3D"]
collision_layer = 20
collision_mask = 5
@@ -108,6 +112,7 @@ script = ExtResource("3_knrd4")
[node name="On Floor" type="Node" parent="State Machine"]
script = ExtResource("4_hck1p")
move_speed = 7.0
move_transition_speed = 7.0
[node name="Dodge Roll" type="Node" parent="State Machine"]
script = ExtResource("5_hck1p")
@@ -146,11 +151,24 @@ libraries = {
&"": SubResource("AnimationLibrary_4qbli")
}
[node name="Area3D" type="Area3D" parent="."]
[node name="PickupMagnet" type="Area3D" parent="."]
collision_layer = 16
collision_mask = 16
[node name="CollisionShape3D" type="CollisionShape3D" parent="Area3D"]
[node name="CollisionShape3D" type="CollisionShape3D" parent="PickupMagnet"]
shape = SubResource("SphereShape3D_juxdh")
[connection signal="body_entered" from="Area3D" to="." method="_on_area_3d_body_entered"]
[node name="MOUSE" parent="." node_paths=PackedStringArray("player") instance=ExtResource("11_2xbkd")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.21551, 0.500001, -0.339623)
player = NodePath("..")
[node name="SwordHit" type="Area3D" parent="."]
collision_layer = 8
collision_mask = 8
[node name="CollisionShape3D" type="CollisionShape3D" parent="SwordHit"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25024, -0.766663)
shape = SubResource("BoxShape3D_2xbkd")
[connection signal="area_entered" from="PickupMagnet" to="." method="_on_area_3d_area_entered"]
[connection signal="body_entered" from="PickupMagnet" to="." method="_on_area_3d_body_entered"]

View File

@@ -1,7 +1,8 @@
[gd_scene load_steps=22 format=4 uid="uid://dctwrgdviw2bq"]
[gd_scene load_steps=24 format=4 uid="uid://dctwrgdviw2bq"]
[ext_resource type="Material" uid="uid://cautxfwhf4hrq" path="res://Assets/Materials/BROWN.tres" id="1_sfuv8"]
[ext_resource type="Material" uid="uid://dv5fpke6frr4n" path="res://Assets/Materials/BLACK.tres" id="1_sq2hy"]
[ext_resource type="Script" uid="uid://blcfh1bg820w7" path="res://Scripts/rat.gd" id="1_xmfkn"]
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o45vq"]
resource_name = "rat1"
@@ -327,9 +328,15 @@ _data = {
&"run": SubResource("Animation_rf35q")
}
[sub_resource type="BoxShape3D" id="BoxShape3D_xmfkn"]
size = Vector3(0.433838, 2.92389, 1)
[node name="rat" type="CharacterBody3D" groups=["breakable", "npc", "rat", "spawned"]]
collision_layer = 64
collision_mask = 45
collision_layer = 8
collision_mask = 9
script = ExtResource("1_xmfkn")
start_health = 3
loot_dropped = 100
[node name="StateMachine" type="Node" parent="."]
@@ -396,4 +403,8 @@ target_position = Vector3(0, 0, -0.2)
transform = Transform3D(0.707107, 0, 0.707107, 0, 1, 0, -0.707107, 0, 0.707107, 0, -0.0699478, -0.342128)
target_position = Vector3(0, 0, -0.2)
[node name="CollisionShape3D2" type="CollisionShape3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.45218, 0)
shape = SubResource("BoxShape3D_xmfkn")
[connection signal="velocity_computed" from="NavigationAgent3D" to="." method="_on_navigation_agent_3d_velocity_computed"]