Updated architecture so WeaponComponent uses an exported array to store

weapon resources.
This commit is contained in:
Henry Faber 2026-06-20 13:05:18 +01:00
parent 63ed0aae3a
commit cf172bc546
7 changed files with 88 additions and 36 deletions

View file

@ -0,0 +1,53 @@
[gd_scene format=3 uid="uid://clpyd8qfwthk2"]
[ext_resource type="Script" uid="uid://c5blhfopjpfny" path="res://scenes/player_weapons/weapon_stock.gd" id="1_nx6aw"]
[ext_resource type="Texture2D" uid="uid://bnpm8b62n1pr5" path="res://graphics/shot_stock_og.png" id="2_s6ult"]
[sub_resource type="AtlasTexture" id="AtlasTexture_5bykt"]
atlas = ExtResource("2_s6ult")
region = Rect2(0, 0, 7, 11)
[sub_resource type="AtlasTexture" id="AtlasTexture_vsqoq"]
atlas = ExtResource("2_s6ult")
region = Rect2(7, 0, 7, 11)
[sub_resource type="AtlasTexture" id="AtlasTexture_yqx5m"]
atlas = ExtResource("2_s6ult")
region = Rect2(14, 0, 7, 11)
[sub_resource type="SpriteFrames" id="SpriteFrames_fdubj"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_5bykt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vsqoq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_yqx5m")
}],
"loop": 1,
"name": &"default",
"speed": 24.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_mvdrj"]
size = Vector2(6.666667, 14)
[node name="StockWeapon" type="Area2D" unique_id=1832200900]
script = ExtResource("1_nx6aw")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="." unique_id=1831184252]
scale = Vector2(1.5, 1.5)
sprite_frames = SubResource("SpriteFrames_fdubj")
autoplay = "default"
frame_progress = 0.35886022
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1890946059]
shape = SubResource("RectangleShape2D_mvdrj")
[node name="VisibleOnScreenNotifier2D" type="VisibleOnScreenNotifier2D" parent="." unique_id=985862716]
rect = Rect2(-3, -7, 6, 14)
[connection signal="screen_exited" from="VisibleOnScreenNotifier2D" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]