Files
ferma/scenes/characters/player/player.tscn
2025-08-22 17:16:22 +05:00

455 lines
12 KiB
Plaintext

[gd_scene load_steps=54 format=3 uid="uid://3u1xjuwdmkit"]
[ext_resource type="Script" uid="uid://d205est0d6jxx" path="res://scenes/characters/player/player.gd" id="1_6avc5"]
[ext_resource type="Texture2D" uid="uid://n61u7n7qeqc5" path="res://assets/game/Characters/basic_character_sprites.png" id="1_7uws0"]
[ext_resource type="Texture2D" uid="uid://dmab45u52gef" path="res://assets/game/Characters/character_sprites.png" id="1_t61fv"]
[ext_resource type="Script" uid="uid://c47padj61m0xm" path="res://scripts/state_machine/node_state_machine.gd" id="3_hss88"]
[ext_resource type="Script" uid="uid://cllwng70ofimo" path="res://scenes/characters/player/idle_state.gd" id="4_qd3e3"]
[ext_resource type="Script" uid="uid://cyxh22il4jswp" path="res://scenes/characters/player/walk_state.gd" id="5_qd3e3"]
[ext_resource type="Script" uid="uid://c4452u1vscx6i" path="res://scenes/characters/player/chopping_state.gd" id="7_mk55u"]
[ext_resource type="Script" uid="uid://cnhdhcvgn2wjs" path="res://scenes/characters/player/tilling_state.gd" id="8_xuses"]
[ext_resource type="Script" uid="uid://b0c6xphnjb3cl" path="res://scenes/characters/player/watering_state.gd" id="9_42irl"]
[ext_resource type="PackedScene" uid="uid://04bcami5g18j" path="res://scenes/components/hit_component.tscn" id="10_3xnwo"]
[sub_resource type="AtlasTexture" id="AtlasTexture_3xnwo"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 240, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_djydg"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 240, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_bsn6e"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 192, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_blysn"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 192, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_hv5x3"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 288, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ykrpk"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 288, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_i1nod"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 336, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_4kqyw"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 336, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_t61fv"]
atlas = ExtResource("1_7uws0")
region = Rect2(0, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_686vu"]
atlas = ExtResource("1_7uws0")
region = Rect2(48, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_hss88"]
atlas = ExtResource("1_7uws0")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_qd3e3"]
atlas = ExtResource("1_7uws0")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_6avc5"]
atlas = ExtResource("1_7uws0")
region = Rect2(0, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_mk55u"]
atlas = ExtResource("1_7uws0")
region = Rect2(48, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_xuses"]
atlas = ExtResource("1_7uws0")
region = Rect2(0, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_42irl"]
atlas = ExtResource("1_7uws0")
region = Rect2(48, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_svuau"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ro20i"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_8y75b"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_tebod"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_6nfx3"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_3hnlq"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_d73qs"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_u6wme"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_bxwvg"]
atlas = ExtResource("1_7uws0")
region = Rect2(96, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_2v4cy"]
atlas = ExtResource("1_7uws0")
region = Rect2(144, 48, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_j8rto"]
atlas = ExtResource("1_7uws0")
region = Rect2(96, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_b4gk5"]
atlas = ExtResource("1_7uws0")
region = Rect2(144, 0, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_r0hd7"]
atlas = ExtResource("1_7uws0")
region = Rect2(96, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_gpigg"]
atlas = ExtResource("1_7uws0")
region = Rect2(144, 96, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_nt8su"]
atlas = ExtResource("1_7uws0")
region = Rect2(96, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_10pim"]
atlas = ExtResource("1_7uws0")
region = Rect2(144, 144, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_pbtrp"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 432, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_es5sa"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 432, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_kxlma"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 384, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_ieypo"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 384, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_sulyr"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 480, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_71adu"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 480, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_xm30n"]
atlas = ExtResource("1_t61fv")
region = Rect2(0, 528, 48, 48)
[sub_resource type="AtlasTexture" id="AtlasTexture_qe74o"]
atlas = ExtResource("1_t61fv")
region = Rect2(48, 528, 48, 48)
[sub_resource type="SpriteFrames" id="SpriteFrames_3xnwo"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3xnwo")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_djydg")
}],
"loop": false,
"name": &"chopping_back",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_bsn6e")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_blysn")
}],
"loop": false,
"name": &"chopping_front",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hv5x3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ykrpk")
}],
"loop": false,
"name": &"chopping_left",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_i1nod")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_4kqyw")
}],
"loop": false,
"name": &"chopping_right",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_t61fv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_686vu")
}],
"loop": true,
"name": &"idle_back",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hss88")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qd3e3")
}],
"loop": true,
"name": &"idle_front",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6avc5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mk55u")
}],
"loop": true,
"name": &"idle_left",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_xuses")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_42irl")
}],
"loop": true,
"name": &"idle_right",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_svuau")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ro20i")
}],
"loop": false,
"name": &"tilling_back",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_8y75b")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_tebod")
}],
"loop": false,
"name": &"tilling_front",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6nfx3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3hnlq")
}],
"loop": false,
"name": &"tilling_left",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_d73qs")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_u6wme")
}],
"loop": false,
"name": &"tilling_right",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_bxwvg")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2v4cy")
}],
"loop": true,
"name": &"walk_back",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_j8rto")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b4gk5")
}],
"loop": true,
"name": &"walk_front",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_r0hd7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gpigg")
}],
"loop": true,
"name": &"walk_left",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_nt8su")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_10pim")
}],
"loop": true,
"name": &"walk_right",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_pbtrp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_es5sa")
}],
"loop": false,
"name": &"watering_back",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_kxlma")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ieypo")
}],
"loop": false,
"name": &"watering_front",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_sulyr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_71adu")
}],
"loop": false,
"name": &"watering_left",
"speed": 3.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_xm30n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qe74o")
}],
"loop": false,
"name": &"watering_right",
"speed": 3.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_t61fv"]
radius = 4.0
[sub_resource type="CircleShape2D" id="CircleShape2D_djydg"]
radius = 2.0
[node name="Player" type="CharacterBody2D"]
y_sort_enabled = true
collision_layer = 2
script = ExtResource("1_6avc5")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -8)
sprite_frames = SubResource("SpriteFrames_3xnwo")
animation = &"tilling_right"
autoplay = "idle_front"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -4)
shape = SubResource("CircleShape2D_t61fv")
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_node_state")]
script = ExtResource("3_hss88")
initial_node_state = NodePath("Idle")
[node name="Idle" type="Node" parent="StateMachine" node_paths=PackedStringArray("player", "animated_sprite_2d")]
script = ExtResource("4_qd3e3")
player = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
[node name="Walk" type="Node" parent="StateMachine" node_paths=PackedStringArray("player", "animated_sprite_2d")]
script = ExtResource("5_qd3e3")
player = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
[node name="Chopping" type="Node" parent="StateMachine" node_paths=PackedStringArray("player", "animated_sprite_2d", "hit_component_collision_shape")]
script = ExtResource("7_mk55u")
player = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
hit_component_collision_shape = NodePath("../../HitComponent/HitComponentCollisionShape2D")
[node name="Tilling" type="Node" parent="StateMachine" node_paths=PackedStringArray("player", "animated_sprite_2d")]
script = ExtResource("8_xuses")
player = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
[node name="Watering" type="Node" parent="StateMachine" node_paths=PackedStringArray("player", "animated_sprite_2d")]
script = ExtResource("9_42irl")
player = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
[node name="HitComponent" parent="." instance=ExtResource("10_3xnwo")]
current_tool = 1
[node name="HitComponentCollisionShape2D" type="CollisionShape2D" parent="HitComponent"]
position = Vector2(9, 0)
shape = SubResource("CircleShape2D_djydg")
debug_color = Color(0.967873, 0.164564, 0.187665, 0.42)