Implemented field creation and wateringcan fill up animation

This commit is contained in:
2025-05-24 21:47:25 +02:00
parent b917fb5fbd
commit a477f9ef4f
7 changed files with 40 additions and 121 deletions
+9 -92
View File
@@ -1,4 +1,4 @@
[gd_scene load_steps=61 format=3 uid="uid://gigb28qk8t12"]
[gd_scene load_steps=56 format=3 uid="uid://gigb28qk8t12"]
[ext_resource type="PackedScene" uid="uid://c25udixd5m6l0" path="res://prefabs/Player2D.tscn" id="1_7wfwe"]
[ext_resource type="Texture2D" uid="uid://8sr11ex30n0m" path="res://art/mockups/Kenney_Backgrounds/Samples/uncolored_hills.png" id="2_7b2ri"]
@@ -31,11 +31,8 @@
[ext_resource type="PackedScene" uid="uid://cqc72e4hq6bcd" path="res://prefabs/interaction_area_2d.tscn" id="27_klb81"]
[ext_resource type="Resource" uid="uid://dlcmqfjvgphqu" path="res://resources/items/rake.tres" id="28_6b2nr"]
[ext_resource type="Resource" uid="uid://cndd64batns31" path="res://resources/items/wateringcan.tres" id="28_ipqaa"]
[ext_resource type="PackedScene" uid="uid://ce0mc0ddijmyi" path="res://prefabs/interactions/sprite_switcher_2d.tscn" id="28_p6n74"]
[ext_resource type="Texture2D" uid="uid://x8hr8287ff2n" path="res://art/farm/farming/farmobjekte/tools atlas.png" id="29_p6n74"]
[ext_resource type="Resource" uid="uid://datee0flk1e84" path="res://resources/items/scythe.tres" id="29_wtdui"]
[ext_resource type="PackedScene" uid="uid://cgjc4wurbgimy" path="res://prefabs/UI/Inventory/Inventory.tscn" id="32_2nee2"]
[ext_resource type="PackedScene" uid="uid://b1d2e7ely6hyw" path="res://prefabs/farm/base_field_2d.tscn" id="33_wtdui"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_xy0kg"]
shader = ExtResource("13_7p0hq")
@@ -128,15 +125,7 @@ size = Vector2(14208, 1176)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_p6n74"]
resource_local_to_scene = true
size = Vector2(7048, 1192)
[sub_resource type="CircleShape2D" id="CircleShape2D_kxdmn"]
resource_local_to_scene = true
radius = 300.0
[sub_resource type="CircleShape2D" id="CircleShape2D_hukxv"]
resource_local_to_scene = true
radius = 300.0
size = Vector2(5415, 1192)
[node name="BabushkaSceneFarmOutside2d" type="Node2D"]
@@ -682,7 +671,7 @@ y_sort_enabled = true
[node name="Vesna" parent="YSorted" node_paths=PackedStringArray("_fieldParent") instance=ExtResource("1_7wfwe")]
z_index = 1
position = Vector2(1071, 2125)
position = Vector2(550, 2125)
_fieldParent = NodePath("../Farm visuals/FieldParent")
_hoe = ExtResource("28_6b2nr")
_wateringCan = ExtResource("28_ipqaa")
@@ -710,7 +699,7 @@ position = Vector2(80, -368)
shape = SubResource("CircleShape2D_p6n74")
[node name="HoeGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(4482, 1978)
position = Vector2(8234, 2076)
[node name="SpawnWithItem" parent="YSorted/HoeGenericPickup" index="0"]
_blueprint = ExtResource("26_ipqaa")
@@ -737,7 +726,7 @@ _blueprint = ExtResource("28_6b2nr")
shape = SubResource("CircleShape2D_ipqaa")
[node name="ScytheGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(11890, 2060)
position = Vector2(15642, 2158)
[node name="SpawnWithItem" parent="YSorted/ScytheGenericPickup" index="0"]
_blueprint = ExtResource("29_wtdui")
@@ -746,7 +735,7 @@ _blueprint = ExtResource("29_wtdui")
shape = SubResource("CircleShape2D_ipqaa")
[node name="ShovelGenericPickup" parent="YSorted" instance=ExtResource("25_hukxv")]
position = Vector2(5229, 2038)
position = Vector2(7593, 2038)
[node name="SpawnWithItem" parent="YSorted/ShovelGenericPickup" index="0"]
_blueprint = ExtResource("27_ipqaa")
@@ -785,81 +774,16 @@ metadata/_custom_type_script = "uid://dhxtdhfqx3bte"
[node name="Area2D" type="Area2D" parent="YSorted/Farm visuals/FieldParent"]
position = Vector2(-48, -16)
collision_mask = 5
collision_priority = 10.0
[node name="CollisionShape2D" type="CollisionShape2D" parent="YSorted/Farm visuals/FieldParent/Area2D"]
position = Vector2(1536, 2964)
position = Vector2(1536, 2949)
shape = SubResource("RectangleShape2D_2nee2")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="YSorted/Farm visuals/FieldParent/Area2D"]
position = Vector2(13772, 2960)
position = Vector2(12955.5, 2960)
shape = SubResource("RectangleShape2D_p6n74")
[node name="TestFields" type="Node" parent="YSorted"]
[node name="BaseField" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(8221, 2809)
[node name="BaseField2" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(8225, 3458)
[node name="BaseField3" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(7492, 2812)
[node name="BaseField4" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(7496, 3458)
[node name="BaseField5" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(11266, 2772)
[node name="BaseField6" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(11270, 3421)
[node name="BaseField7" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(10537, 2775)
[node name="BaseField8" parent="YSorted/TestFields" instance=ExtResource("33_wtdui")]
position = Vector2(10541, 3421)
[node name="Hoe Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
visible = false
position = Vector2(7728, 2000)
rotation = 3.3074
_sprites = NodePath("SpriteSwitcher2d")
[node name="Area2D" parent="Hoe Pickup" index="0"]
collision_mask = 5
[node name="CollisionShape3D" parent="Hoe Pickup/Area2D" index="0"]
shape = SubResource("CircleShape2D_kxdmn")
[node name="SpriteSwitcher2d" parent="Hoe Pickup" instance=ExtResource("28_p6n74")]
scale = Vector2(0.5, 0.5)
[node name="Watercan Pickup" parent="." node_paths=PackedStringArray("_sprites") instance=ExtResource("27_klb81")]
visible = false
position = Vector2(8400, 2024)
_sprites = NodePath("ActiveInactive")
_id = 1
[node name="Area2D" parent="Watercan Pickup" index="0"]
collision_mask = 5
[node name="CollisionShape3D" parent="Watercan Pickup/Area2D" index="0"]
shape = SubResource("CircleShape2D_hukxv")
[node name="Label" parent="Watercan Pickup" index="1"]
z_index = 1
[node name="ActiveInactive" parent="Watercan Pickup" instance=ExtResource("28_p6n74")]
[node name="ActiveSprite" parent="Watercan Pickup/ActiveInactive" index="0"]
texture = ExtResource("29_p6n74")
region_rect = Rect2(-2, 1135, 421, 292)
[node name="InactiveSprite" parent="Watercan Pickup/ActiveInactive" index="1"]
texture = ExtResource("29_p6n74")
region_rect = Rect2(1, 1138, 418, 288)
[node name="CanvasLayer" parent="." instance=ExtResource("32_2nee2")]
follow_viewport_enabled = false
@@ -876,13 +800,9 @@ size_flags_horizontal = 4
size_flags_vertical = 8
_inventoryOpenedOffset = -600.0
[connection signal="PickedUpTool" from="YSorted/Vesna" to="Hoe Pickup" method="SetSpriteActiveState"]
[connection signal="PickedUpTool" from="YSorted/Vesna" to="Watercan Pickup" method="SetSpriteActiveState"]
[connection signal="InteractedTool" from="YSorted/Brünnen/InteractionArea" to="YSorted/Vesna" method="TryFillWateringCan"]
[connection signal="mouse_entered" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseEnteredAllowedArea"]
[connection signal="mouse_exited" from="YSorted/Farm visuals/FieldParent/Area2D" to="YSorted/Farm visuals/FieldParent" method="MouseExitedAllowedArea"]
[connection signal="InteractedTool" from="Hoe Pickup" to="YSorted/Vesna" method="ActivateTool"]
[connection signal="InteractedTool" from="Watercan Pickup" to="YSorted/Vesna" method="ActivateTool"]
[editable path="YSorted/Vesna"]
[editable path="YSorted/Brünnen/InteractionArea"]
@@ -896,7 +816,4 @@ _inventoryOpenedOffset = -600.0
[editable path="YSorted/ScytheGenericPickup/InteractionArea2"]
[editable path="YSorted/ShovelGenericPickup"]
[editable path="YSorted/ShovelGenericPickup/InteractionArea2"]
[editable path="Hoe Pickup"]
[editable path="Watercan Pickup"]
[editable path="Watercan Pickup/ActiveInactive"]
[editable path="CanvasLayer"]