Item pickup

This commit is contained in:
2025-08-29 12:33:10 +08:00
parent 850628ca72
commit fac5e5a597
12 changed files with 191 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=7 format=3 uid="uid://c22aprj452aha"]
[gd_scene load_steps=8 format=3 uid="uid://c22aprj452aha"]
[ext_resource type="Script" uid="uid://cudpc3w17mbsw" path="res://Scripts/System/GridManager.cs" id="1_knkkn"]
[ext_resource type="Script" uid="uid://dfi2snip78eq6" path="res://Scripts/System/ResourceManager.cs" id="1_pl8e4"]
@@ -6,6 +6,7 @@
[ext_resource type="Script" uid="uid://cugfbvw70clgd" path="res://Scripts/System/NaturalResourceGenerator.cs" id="2_oss8w"]
[ext_resource type="Script" uid="uid://bx1wj7gn6vrqe" path="res://Scripts/System/PlacementManager.cs" id="2_sxhdm"]
[ext_resource type="PackedScene" uid="uid://doxy60afddg1m" path="res://Scenes/Entities/Player.tscn" id="3_oss8w"]
[ext_resource type="PackedScene" uid="uid://xwkplaxmye3v" path="res://Scenes/System/ItemPickup.tscn" id="7_is6ib"]
[node name="Root" type="Node2D"]
@@ -29,5 +30,16 @@ Grid = NodePath("../GridSystem")
Inventory = NodePath("../ResourceSystem")
Registry = NodePath("../BuildingRegistry")
[node name="Player" parent="." instance=ExtResource("3_oss8w")]
[node name="Player" parent="." node_paths=PackedStringArray("Inventory") instance=ExtResource("3_oss8w")]
scale = Vector2(0.35, 0.35)
Inventory = NodePath("../ResourceSystem")
[node name="ItemPickup" parent="." instance=ExtResource("7_is6ib")]
position = Vector2(-496, -245)
ItemId = "stone"
Infinite = true
[node name="ItemPickup2" parent="." instance=ExtResource("7_is6ib")]
position = Vector2(-495, 5)
ItemId = "ore_iron"
Infinite = true

View File

@@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3 uid="uid://xwkplaxmye3v"]
[ext_resource type="Texture2D" uid="uid://d3mn15csjooch" path="res://Assets/Items/StoneItem.png" id="1_4weev"]
[ext_resource type="Script" uid="uid://qgcue2doj2lf" path="res://Scripts/System/ItemPickup.cs" id="1_ps3kh"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4weev"]
size = Vector2(160, 160)
[node name="ItemPickup" type="Node2D"]
script = ExtResource("1_ps3kh")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.05, 0.05)
texture = ExtResource("1_4weev")
[node name="Area2D" type="Area2D" parent="."]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
shape = SubResource("RectangleShape2D_4weev")