-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.tscn
113 lines (95 loc) · 3.65 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
[gd_scene load_steps=15 format=3 uid="uid://cwudqfw3mu538"]
[ext_resource type="Script" path="res://player.gd" id="1_k02mk"]
[ext_resource type="Texture2D" uid="uid://bwwuwyyh850l5" path="res://assets/knight_f_idle_anim_f0.png" id="2_4l3c1"]
[ext_resource type="Texture2D" uid="uid://dqqyacs24ns37" path="res://assets/knight_f_idle_anim_f1.png" id="3_4oi28"]
[ext_resource type="Texture2D" uid="uid://dkwwktlof0s27" path="res://assets/knight_f_idle_anim_f2.png" id="4_ywate"]
[ext_resource type="Texture2D" uid="uid://bnomt04nrynha" path="res://assets/knight_f_idle_anim_f3.png" id="5_3nbgj"]
[ext_resource type="Texture2D" uid="uid://db0j62e2uj62r" path="res://assets/knight_f_run_anim_f0.png" id="6_2jinm"]
[ext_resource type="Texture2D" uid="uid://sc4icrnxmr3m" path="res://assets/knight_f_run_anim_f1.png" id="7_bub38"]
[ext_resource type="Texture2D" uid="uid://dfgkq58bkrcbh" path="res://assets/knight_f_run_anim_f2.png" id="8_w51gf"]
[ext_resource type="Texture2D" uid="uid://cabh6beab10rq" path="res://assets/knight_f_run_anim_f3.png" id="9_hyawl"]
[ext_resource type="Texture2D" uid="uid://bdfpqjt4xm384" path="res://assets/weapon_regular_sword.png" id="10_u4imy"]
[sub_resource type="SpriteFrames" id="SpriteFrames_dyc3l"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_4l3c1")
}, {
"duration": 1.0,
"texture": ExtResource("3_4oi28")
}, {
"duration": 1.0,
"texture": ExtResource("4_ywate")
}, {
"duration": 1.0,
"texture": ExtResource("5_3nbgj")
}],
"loop": true,
"name": &"idle",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("6_2jinm")
}, {
"duration": 1.0,
"texture": ExtResource("7_bub38")
}, {
"duration": 1.0,
"texture": ExtResource("8_w51gf")
}, {
"duration": 1.0,
"texture": ExtResource("9_hyawl")
}],
"loop": true,
"name": &"run",
"speed": 5.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_48xwm"]
size = Vector2(8, 12)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_bq6pj"]
size = Vector2(8, 22)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_0aoe1"]
size = Vector2(16, 24)
[node name="Player" type="CharacterBody2D"]
position = Vector2(0, -4)
scale = Vector2(2, 2)
collision_mask = 4
script = ExtResource("1_k02mk")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(2, 2)
sprite_frames = SubResource("SpriteFrames_dyc3l")
animation = &"run"
frame_progress = 0.749789
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(0, 10)
scale = Vector2(2, 2)
shape = SubResource("RectangleShape2D_48xwm")
[node name="Weapon" type="Node2D" parent="."]
[node name="Area2D" type="Area2D" parent="Weapon"]
position = Vector2(12, 14)
collision_layer = 8
collision_mask = 2
[node name="Sprite2D" type="Sprite2D" parent="Weapon/Area2D"]
z_index = -1
position = Vector2(0, -8)
scale = Vector2(1.5, 1.5)
texture = ExtResource("10_u4imy")
[node name="CollisionShape2D" type="CollisionShape2D" parent="Weapon/Area2D"]
position = Vector2(0, -11)
shape = SubResource("RectangleShape2D_bq6pj")
[node name="AttackTimer" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[node name="AttackCooldownTimer" type="Timer" parent="."]
one_shot = true
[node name="EnemyCollision" type="Area2D" parent="."]
collision_mask = 2
[node name="CollisionShape2D" type="CollisionShape2D" parent="EnemyCollision"]
position = Vector2(0, 10)
shape = SubResource("RectangleShape2D_0aoe1")
[node name="InvincibilityTimer" type="Timer" parent="."]
wait_time = 0.5
one_shot = true
[connection signal="body_entered" from="EnemyCollision" to="." method="_on_area_2d_body_entered"]
[connection signal="timeout" from="InvincibilityTimer" to="." method="_on_invincibility_timer_timeout"]