-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.tscn
122 lines (105 loc) · 3.7 KB
/
Player.tscn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
[gd_scene load_steps=13 format=3 uid="uid://cxyijr3k7hrxt"]
[ext_resource type="Script" path="res://player.gd" id="1_rwx5j"]
[ext_resource type="Texture2D" uid="uid://b4rjt8nc7wfdc" path="res://assets/viking2.png" id="2_yk1jg"]
[ext_resource type="Script" path="res://state_machine.gd" id="3_p5if8"]
[ext_resource type="Script" path="res://States/player_idle.gd" id="4_mn2l4"]
[ext_resource type="Script" path="res://States/player_walk.gd" id="5_fkad7"]
[ext_resource type="Script" path="res://player_attack.gd" id="6_amcmg"]
[sub_resource type="Animation" id="Animation_dtvic"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [9]
}
[sub_resource type="Animation" id="Animation_qyya6"]
resource_name = "attack"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1),
"update": 1,
"values": [27, 28, 29, 30, 31]
}
[sub_resource type="Animation" id="Animation_qnc1l"]
resource_name = "idle"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [0, 1, 2, 4, 5, 6]
}
[sub_resource type="Animation" id="Animation_eppk7"]
resource_name = "walk_side"
length = 0.6
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Sprite2D:frame")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.1, 0.2, 0.3, 0.4, 0.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1),
"update": 1,
"values": [9, 10, 11, 12, 13, 14]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_i214p"]
_data = {
"RESET": SubResource("Animation_dtvic"),
"attack": SubResource("Animation_qyya6"),
"idle": SubResource("Animation_qnc1l"),
"walk_side": SubResource("Animation_eppk7")
}
[sub_resource type="RectangleShape2D" id="RectangleShape2D_xkxcr"]
[node name="Player" type="CharacterBody2D"]
script = ExtResource("1_rwx5j")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_yk1jg")
hframes = 9
vframes = 6
frame = 9
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_i214p")
}
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(3, 6)
shape = SubResource("RectangleShape2D_xkxcr")
[node name="StateMachine" type="Node" parent="." node_paths=PackedStringArray("initial_state")]
script = ExtResource("3_p5if8")
initial_state = NodePath("Idle")
[node name="Idle" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
script = ExtResource("4_mn2l4")
player = NodePath("../..")
[node name="Walk" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
script = ExtResource("5_fkad7")
player = NodePath("../..")
[node name="Attack" type="Node" parent="StateMachine" node_paths=PackedStringArray("player")]
script = ExtResource("6_amcmg")
player = NodePath("../..")
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(0, -57)
[connection signal="animation_finished" from="AnimationPlayer" to="StateMachine/Attack" method="_on_animation_player_animation_finished"]