55 lines
1.9 KiB
Plaintext
55 lines
1.9 KiB
Plaintext
[gd_scene load_steps=5 format=3 uid="uid://snjgu4yp5swd"]
|
|
|
|
[ext_resource type="PackedScene" uid="uid://ce40pq785yoyi" path="res://objects/weapons/rifle.tscn" id="1_eqqp1"]
|
|
|
|
[sub_resource type="GDScript" id="GDScript_eqqp1"]
|
|
script/source = "extends HealthStatus
|
|
|
|
func _on_health_changed(remaining: int, delta: int) -> void:
|
|
print(\"Player Health Changed:\", delta, \"remaining:\", remaining)
|
|
|
|
func _on_death() -> void:
|
|
get_tree().change_scene_to_file.call_deferred(\"res://menus/main_menu.tscn\")
|
|
"
|
|
|
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_bxedw"]
|
|
|
|
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_eqqp1"]
|
|
radius = 0.3173828
|
|
|
|
[node name="PlayerBody" type="PlayerBody"]
|
|
|
|
[node name="PlayerCamera" type="PlayerCamera" parent="."]
|
|
unique_name_in_owner = true
|
|
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 1.60811, 0)
|
|
fov = 60.0
|
|
|
|
[node name="PlayerInput" type="PlayerInput" parent="."]
|
|
unique_name_in_owner = true
|
|
process_mode = 3
|
|
|
|
[node name="WeaponInventory" type="WeaponInventory" parent="."]
|
|
unique_name_in_owner = true
|
|
starting_weapon = ExtResource("1_eqqp1")
|
|
|
|
[node name="HealthStatus" type="HealthStatus" parent="."]
|
|
health = 10
|
|
script = SubResource("GDScript_eqqp1")
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|
shape = SubResource("CapsuleShape3D_bxedw")
|
|
|
|
[node name="Hitbox" type="Hitbox" parent="." node_paths=PackedStringArray("health")]
|
|
collision_layer = 8
|
|
collision_mask = 0
|
|
monitoring = false
|
|
health = NodePath("../HealthStatus")
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Hitbox"]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|
shape = SubResource("CapsuleShape3D_eqqp1")
|
|
|
|
[connection signal="death" from="HealthStatus" to="HealthStatus" method="_on_death"]
|
|
[connection signal="health_changed" from="HealthStatus" to="HealthStatus" method="_on_health_changed"]
|