feat: added interactions, demo packs and destructables

This commit is contained in:
Sara 2025-07-28 21:17:11 +02:00
parent d66c999039
commit 5a4ac26c72
12 changed files with 369 additions and 23 deletions

View file

@ -0,0 +1,27 @@
[gd_scene load_steps=4 format=3 uid="uid://cclghy01gblif"]
[sub_resource type="SphereShape3D" id="SphereShape3D_kl827"]
radius = 0.1282442
[sub_resource type="GDScript" id="GDScript_kl827"]
script/source = "extends Interactable
func _activated(interactor: PlayerInteractor) -> void:
interactor.pickup_demo_pack()
get_owner().queue_free()
"
[sub_resource type="BoxMesh" id="BoxMesh_kl827"]
size = Vector3(0.2, 0.1, 0.2)
[node name="DemoPackPickup" type="StaticBody3D"]
collision_layer = 18
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_kl827")
[node name="Interactable" type="Interactable" parent="."]
script = SubResource("GDScript_kl827")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("BoxMesh_kl827")

View file

@ -1,7 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://snjgu4yp5swd"]
[gd_scene load_steps=6 format=3 uid="uid://snjgu4yp5swd"]
[ext_resource type="PackedScene" uid="uid://ce40pq785yoyi" path="res://objects/weapons/rifle.tscn" id="1_eqqp1"]
[sub_resource type="SphereShape3D" id="SphereShape3D_eqqp1"]
radius = 0.2
[sub_resource type="GDScript" id="GDScript_eqqp1"]
script/source = "extends HealthStatus
@ -23,6 +26,12 @@ 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="PlayerInteractor" type="PlayerInteractor" parent="PlayerCamera"]
shape = SubResource("SphereShape3D_eqqp1")
target_position = Vector3(0, 0, -2)
collision_mask = 22
collide_with_areas = true
[node name="PlayerInput" type="PlayerInput" parent="."]
unique_name_in_owner = true
process_mode = 3