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

98 lines
3.2 KiB
Plaintext

[gd_scene load_steps=14 format=3 uid="uid://bna1f7ugd2ye6"]
[ext_resource type="Texture2D" uid="uid://te3dft51x8yj" path="res://assets/game/Characters/chicken_sprites.png" id="1_be5x3"]
[ext_resource type="Script" uid="uid://cw3vwyuw1ogw3" path="res://scenes/characters/chicken/chicken.gd" id="1_r6a33"]
[ext_resource type="Script" uid="uid://c47padj61m0xm" path="res://scripts/state_machine/node_state_machine.gd" id="2_awcwn"]
[ext_resource type="Script" uid="uid://b0y0fxeo52kqi" path="res://scripts/state_machine/npc_states/idle_state.gd" id="3_31inw"]
[ext_resource type="Script" uid="uid://ciwbskg1hsree" path="res://scripts/state_machine/npc_states/walk_state.gd" id="4_31inw"]
[sub_resource type="AtlasTexture" id="AtlasTexture_rsly8"]
atlas = ExtResource("1_be5x3")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_awcwn"]
atlas = ExtResource("1_be5x3")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_be5x3"]
atlas = ExtResource("1_be5x3")
region = Rect2(0, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_31inw"]
atlas = ExtResource("1_be5x3")
region = Rect2(16, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_r6a33"]
atlas = ExtResource("1_be5x3")
region = Rect2(32, 16, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_asyyu"]
atlas = ExtResource("1_be5x3")
region = Rect2(48, 16, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_31inw"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_rsly8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_awcwn")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_be5x3")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_31inw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_r6a33")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_asyyu")
}],
"loop": true,
"name": &"walk",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_hv82h"]
radius = 4.0
[node name="Chicken" type="CharacterBody2D"]
script = ExtResource("1_r6a33")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -6)
sprite_frames = SubResource("SpriteFrames_31inw")
animation = &"walk"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, -4)
shape = SubResource("CircleShape2D_hv82h")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="."]
radius = 5.0
debug_enabled = true
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_node_state")]
script = ExtResource("2_awcwn")
initial_node_state = NodePath("Idle")
[node name="Idle" type="Node" parent="StateMachine" node_paths=PackedStringArray("character", "animated_sprite_2d")]
script = ExtResource("3_31inw")
character = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
[node name="Walk" type="Node" parent="StateMachine" node_paths=PackedStringArray("character", "animated_sprite_2d", "navigation_agent_2d")]
script = ExtResource("4_31inw")
character = NodePath("../..")
animated_sprite_2d = NodePath("../../AnimatedSprite2D")
navigation_agent_2d = NodePath("../../NavigationAgent2D")