feat: rifle pickup added to map
This commit is contained in:
parent
2511ac69c0
commit
6b7a092961
8 changed files with 57 additions and 6 deletions
39
project/objects/pickups/weapon_pickup.tscn
Normal file
39
project/objects/pickups/weapon_pickup.tscn
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://crml35t12hx2h"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ce40pq785yoyi" path="res://objects/weapons/rifle.tscn" id="1_y6dn2"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_fn0cd"]
|
||||
script/source = "extends Interactable
|
||||
|
||||
@export var weapon_name : String = \"Rifle\"
|
||||
@export var weapon_scene : PackedScene
|
||||
|
||||
func _highlight_changed(_interactor: PlayerInteractor, value: bool) -> void:
|
||||
var hud := HeadsUpDisplay.get_singleton()
|
||||
if hud:
|
||||
hud.set_tooltip(\"Pick up %s\" % weapon_name if value else \"\")
|
||||
|
||||
func _activated(interactor: PlayerInteractor) -> void:
|
||||
interactor.get_inventory().pickup_weapon(weapon_scene)
|
||||
get_parent().queue_free()
|
||||
"
|
||||
|
||||
[sub_resource type="BoxMesh" id="BoxMesh_fn0cd"]
|
||||
size = Vector3(0.2, 0.1, 0.7)
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_fn0cd"]
|
||||
size = Vector3(0.20874023, 0.115478516, 0.7109375)
|
||||
|
||||
[node name="WeaponPickup" type="StaticBody3D"]
|
||||
collision_layer = 16
|
||||
collision_mask = 0
|
||||
|
||||
[node name="Interactable" type="Interactable" parent="."]
|
||||
script = SubResource("GDScript_fn0cd")
|
||||
weapon_scene = ExtResource("1_y6dn2")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
mesh = SubResource("BoxMesh_fn0cd")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("BoxShape3D_fn0cd")
|
||||
Loading…
Add table
Add a link
Reference in a new issue